Files
sdk/pkg/vm_service/test/mixin_break_test.dart
Jens Johansen 73a059d406 [ package:vm_service ] Make update_line_numbers tool be able to update entire folder
Also add functionality for the tool to do offsets.

Finally run in on the pkg/vm_service/test/ folder.

Change-Id: Ifa4ca60ed0707e6211baf4b9df140802d5cecf6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404881
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2025-01-23 06:31:51 -08:00

63 lines
1.5 KiB
Dart

// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:developer';
import 'common/service_test_common.dart';
import 'common/test_helper.dart';
import 'mixin_break/mixin_break_class1.dart';
import 'mixin_break/mixin_break_class2.dart';
import 'mixin_break/mixin_break_mixin_class.dart';
// AUTOGENERATED START
//
// Update these constants by running:
//
// dart pkg/vm_service/test/update_line_numbers.dart pkg/vm_service/test/mixin_break_test.dart
//
const LINE_A = 30;
// AUTOGENERATED END
const file = 'mixin_break_mixin_class.dart';
int codeRuns = 0;
void code() {
if (++codeRuns > 1) {
print('Calling debugger!');
debugger(); // LINE_A
}
final a = Hello1();
final b = Hello2();
a.speak();
b.speak();
print('Both now compiled');
}
final stops = <String>[];
const expected = <String>[
'$file:$LINE_B:5 (mixin_break_class1.dart:$LINE_B1:5)',
'$file:$LINE_B:5 (mixin_break_class2.dart:$LINE_B2:5)',
];
final tests = <IsolateTest>[
hasStoppedAtBreakpoint,
stoppedAtLine(LINE_A),
setBreakpointAtUriAndLine(file, LINE_B),
resumeProgramRecordingStops(stops, true),
checkRecordedStops(stops, expected),
];
void main([args = const <String>[]]) => runIsolateTests(
args,
tests,
'mixin_break_test.dart',
testeeBefore: code,
testeeConcurrent: code,
pauseOnStart: false,
pauseOnExit: true,
);