dart-sdk/pkg/vm_service/test/eval_skip_breakpoint.dart
Ben Konyi ad4d10a42c [ package:vm_service ] Migrate Observatory service tests to package:vm_service (Pt 2)
See https://github.com/dart-lang/sdk/issues/45037

TEST=pkg/vm_service/test/*

Change-Id: I0632744fdea0da63a47d64299cbd1f96f45dcb3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186742
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-05 00:12:29 +00:00

55 lines
1.2 KiB
Dart

// Copyright (c) 2019, 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.
// VMOptions=--verbose_debug
import 'dart:developer';
import 'package:vm_service/vm_service.dart';
import 'common/service_test_common.dart';
import 'common/test_helper.dart';
const int LINE_A = 22;
const int LINE_B = 17;
bar() {
print('bar');
}
testMain() {
debugger();
bar();
print("Done");
}
var tests = <IsolateTest>[
hasStoppedAtBreakpoint,
stoppedAtLine(LINE_A),
// Add breakpoint
setBreakpointAtLine(LINE_B),
// Evaluate 'bar()'
(VmService service, IsolateRef isolateRef) async {
final isolate = await service.getIsolate(isolateRef.id!);
await service.evaluate(
isolateRef.id!,
isolate.rootLib!.id!,
'bar()',
disableBreakpoints: true,
);
},
hasStoppedAtBreakpoint,
stoppedAtLine(LINE_A),
resumeIsolate,
hasStoppedAtBreakpoint,
stoppedAtLine(LINE_B),
resumeIsolate,
];
main([args = const <String>[]]) => runIsolateTests(
args,
tests,
'eval_skip_breakpoint.dart',
testeeConcurrent: testMain,
);