| Index: runtime/observatory/tests/service/break_on_activation_test.dart
|
| diff --git a/runtime/observatory/tests/service/break_on_activation_test.dart b/runtime/observatory/tests/service/break_on_activation_test.dart
|
| index 7169ad48d5a97177e9ef91c668f73c52b1041160..6291de546a6ae302b8a2f21e79b8873d0ec08396 100644
|
| --- a/runtime/observatory/tests/service/break_on_activation_test.dart
|
| +++ b/runtime/observatory/tests/service/break_on_activation_test.dart
|
| @@ -47,160 +47,162 @@ void testeeDoNamed() {
|
| r3_named(y: 'Not a closure', x: 'Not a closure');
|
| }
|
|
|
| +
|
| var tests = [
|
| - (Isolate isolate) async {
|
| - var rootLib = await isolate.rootLibrary.load();
|
| -
|
| - var breaksHit = 0;
|
| -
|
| - var subscriptionFuture =
|
| - isolate.vm.listenEventStream(VM.kDebugStream, (ServiceEvent event) {
|
| - if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| - print("Hit breakpoint ${event.breakpoint}");
|
| - breaksHit++;
|
| - isolate.resume();
|
| - }
|
| - });
|
| -
|
| - valueOfField(String name) async {
|
| - var field = rootLib.variables.singleWhere((v) => v.name == name);
|
| - await field.load();
|
| - return field.staticValue;
|
| - }
|
| -
|
| - var r1Ref = await valueOfField('r1');
|
| -
|
| - var bpt1 = await isolate.addBreakOnActivation(r1Ref);
|
| - print("Added breakpoint $bpt1");
|
| - expect(bpt1 is Breakpoint, isTrue);
|
| - expect(breaksHit, equals(0));
|
| - await r1Ref.reload();
|
| - expect(r1Ref.activationBreakpoint, equals(bpt1));
|
| - print("testeeDo()");
|
| - var res = await rootLib.evaluate("testeeDo()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(1));
|
| -
|
| - await isolate.removeBreakpoint(bpt1);
|
| - print("Removed breakpoint $bpt1");
|
| - print("testeeDo()");
|
| - await r1Ref.reload();
|
| - expect(r1Ref.activationBreakpoint, equals(null));
|
| - res = await rootLib.evaluate("testeeDo()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(1));
|
| -
|
| - await cancelFutureSubscription(subscriptionFuture);
|
| - },
|
| - (Isolate isolate) async {
|
| - var rootLib = await isolate.rootLibrary.load();
|
| -
|
| - var breaksHit = 0;
|
| -
|
| - var subscriptionFuture =
|
| - isolate.vm.listenEventStream(VM.kDebugStream, (ServiceEvent event) {
|
| - if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| - print("Hit breakpoint ${event.breakpoint}");
|
| - breaksHit++;
|
| - isolate.resume();
|
| - }
|
| - });
|
| -
|
| - valueOfField(String name) async {
|
| - var field = rootLib.variables.singleWhere((v) => v.name == name);
|
| - await field.load();
|
| - return field.staticValue;
|
| - }
|
| -
|
| - var r1Ref = await valueOfField('r1_named');
|
| -
|
| - var bpt1 = await isolate.addBreakOnActivation(r1Ref);
|
| - print("Added breakpoint $bpt1");
|
| - expect(bpt1 is Breakpoint, isTrue);
|
| - expect(breaksHit, equals(0));
|
| - await r1Ref.reload();
|
| - expect(r1Ref.activationBreakpoint, equals(bpt1));
|
| - print("testeeDoNamed()");
|
| - var res = await rootLib.evaluate("testeeDoNamed()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(1));
|
| -
|
| - await isolate.removeBreakpoint(bpt1);
|
| - print("Removed breakpoint $bpt1");
|
| - await r1Ref.reload();
|
| - expect(r1Ref.activationBreakpoint, equals(null));
|
| - print("testeeDoNamed()");
|
| - res = await rootLib.evaluate("testeeDoNamed()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(1));
|
| -
|
| - await cancelFutureSubscription(subscriptionFuture);
|
| - },
|
| - (Isolate isolate) async {
|
| - var rootLib = await isolate.rootLibrary.load();
|
| -
|
| - var breaksHit = 0;
|
| -
|
| - var subscriptionFuture =
|
| - isolate.vm.listenEventStream(VM.kDebugStream, (ServiceEvent event) {
|
| - if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| - print("Hit breakpoint ${event.breakpoint}");
|
| - breaksHit++;
|
| - isolate.resume();
|
| - }
|
| - });
|
| -
|
| - valueOfField(String name) async {
|
| - var field = rootLib.variables.singleWhere((v) => v.name == name);
|
| - await field.load();
|
| - return field.staticValue;
|
| - }
|
| -
|
| - var r1Ref = await valueOfField('r1');
|
| - var r2Ref = await valueOfField('r2');
|
| -
|
| - var bpt1 = await isolate.addBreakOnActivation(r1Ref);
|
| - print("Added breakpoint $bpt1");
|
| - expect(bpt1 is Breakpoint, isTrue);
|
| - expect(breaksHit, equals(0));
|
| - await r1Ref.reload();
|
| - expect(r1Ref.activationBreakpoint, equals(bpt1));
|
| - print("testeeDo()");
|
| - var res = await rootLib.evaluate("testeeDo()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(1));
|
| -
|
| - var bpt2 = await isolate.addBreakOnActivation(r2Ref);
|
| - print("Added breakpoint $bpt2");
|
| - expect(bpt2 is Breakpoint, isTrue);
|
| - expect(breaksHit, equals(1));
|
| - await r2Ref.reload();
|
| - expect(r2Ref.activationBreakpoint, equals(bpt2));
|
| - print("testeeDo()");
|
| - res = await rootLib.evaluate("testeeDo()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(3));
|
| -
|
| - await isolate.removeBreakpoint(bpt1);
|
| - print("Removed breakpoint $bpt1");
|
| - await r1Ref.reload();
|
| - expect(r1Ref.activationBreakpoint, equals(null));
|
| - print("testeeDo()");
|
| - res = await rootLib.evaluate("testeeDo()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(4));
|
| -
|
| - await isolate.removeBreakpoint(bpt2);
|
| - print("Removed breakpoint $bpt2");
|
| - await r2Ref.reload();
|
| - expect(r2Ref.activationBreakpoint, equals(null));
|
| - print("testeeDo()");
|
| - res = await rootLib.evaluate("testeeDo()");
|
| - expect(res is Instance, isTrue); // Not error.
|
| - expect(breaksHit, equals(4));
|
| -
|
| - await cancelFutureSubscription(subscriptionFuture);
|
| - },
|
| +(Isolate isolate) async {
|
| + var rootLib = await isolate.rootLibrary.load();
|
| +
|
| + var breaksHit = 0;
|
| +
|
| + var subscriptionFuture = isolate.vm.listenEventStream(
|
| + VM.kDebugStream, (ServiceEvent event) {
|
| + if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| + print("Hit breakpoint ${event.breakpoint}");
|
| + breaksHit++;
|
| + isolate.resume();
|
| + }
|
| + });
|
| +
|
| + valueOfField(String name) async {
|
| + var field = rootLib.variables.singleWhere((v) => v.name == name);
|
| + await field.load();
|
| + return field.staticValue;
|
| +
|
| + }
|
| + var r1Ref = await valueOfField('r1');
|
| +
|
| + var bpt1 = await isolate.addBreakOnActivation(r1Ref);
|
| + print("Added breakpoint $bpt1");
|
| + expect(bpt1 is Breakpoint, isTrue);
|
| + expect(breaksHit, equals(0));
|
| + await r1Ref.reload();
|
| + expect(r1Ref.activationBreakpoint, equals(bpt1));
|
| + print("testeeDo()");
|
| + var res = await rootLib.evaluate("testeeDo()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(1));
|
| +
|
| + await isolate.removeBreakpoint(bpt1);
|
| + print("Removed breakpoint $bpt1");
|
| + print("testeeDo()");
|
| + await r1Ref.reload();
|
| + expect(r1Ref.activationBreakpoint, equals(null));
|
| + res = await rootLib.evaluate("testeeDo()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(1));
|
| +
|
| + await cancelFutureSubscription(subscriptionFuture);
|
| +},
|
| +
|
| +(Isolate isolate) async {
|
| + var rootLib = await isolate.rootLibrary.load();
|
| +
|
| + var breaksHit = 0;
|
| +
|
| + var subscriptionFuture = isolate.vm.listenEventStream(
|
| + VM.kDebugStream, (ServiceEvent event) {
|
| + if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| + print("Hit breakpoint ${event.breakpoint}");
|
| + breaksHit++;
|
| + isolate.resume();
|
| + }
|
| + });
|
| +
|
| + valueOfField(String name) async {
|
| + var field = rootLib.variables.singleWhere((v) => v.name == name);
|
| + await field.load();
|
| + return field.staticValue;
|
| + }
|
| + var r1Ref = await valueOfField('r1_named');
|
| +
|
| + var bpt1 = await isolate.addBreakOnActivation(r1Ref);
|
| + print("Added breakpoint $bpt1");
|
| + expect(bpt1 is Breakpoint, isTrue);
|
| + expect(breaksHit, equals(0));
|
| + await r1Ref.reload();
|
| + expect(r1Ref.activationBreakpoint, equals(bpt1));
|
| + print("testeeDoNamed()");
|
| + var res = await rootLib.evaluate("testeeDoNamed()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(1));
|
| +
|
| + await isolate.removeBreakpoint(bpt1);
|
| + print("Removed breakpoint $bpt1");
|
| + await r1Ref.reload();
|
| + expect(r1Ref.activationBreakpoint, equals(null));
|
| + print("testeeDoNamed()");
|
| + res = await rootLib.evaluate("testeeDoNamed()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(1));
|
| +
|
| + await cancelFutureSubscription(subscriptionFuture);
|
| +},
|
| +
|
| +(Isolate isolate) async {
|
| + var rootLib = await isolate.rootLibrary.load();
|
| +
|
| + var breaksHit = 0;
|
| +
|
| + var subscriptionFuture = isolate.vm.listenEventStream(
|
| + VM.kDebugStream, (ServiceEvent event) {
|
| + if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| + print("Hit breakpoint ${event.breakpoint}");
|
| + breaksHit++;
|
| + isolate.resume();
|
| + }
|
| + });
|
| +
|
| + valueOfField(String name) async {
|
| + var field = rootLib.variables.singleWhere((v) => v.name == name);
|
| + await field.load();
|
| + return field.staticValue;
|
| + }
|
| + var r1Ref = await valueOfField('r1');
|
| + var r2Ref = await valueOfField('r2');
|
| +
|
| + var bpt1 = await isolate.addBreakOnActivation(r1Ref);
|
| + print("Added breakpoint $bpt1");
|
| + expect(bpt1 is Breakpoint, isTrue);
|
| + expect(breaksHit, equals(0));
|
| + await r1Ref.reload();
|
| + expect(r1Ref.activationBreakpoint, equals(bpt1));
|
| + print("testeeDo()");
|
| + var res = await rootLib.evaluate("testeeDo()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(1));
|
| +
|
| + var bpt2 = await isolate.addBreakOnActivation(r2Ref);
|
| + print("Added breakpoint $bpt2");
|
| + expect(bpt2 is Breakpoint, isTrue);
|
| + expect(breaksHit, equals(1));
|
| + await r2Ref.reload();
|
| + expect(r2Ref.activationBreakpoint, equals(bpt2));
|
| + print("testeeDo()");
|
| + res = await rootLib.evaluate("testeeDo()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(3));
|
| +
|
| + await isolate.removeBreakpoint(bpt1);
|
| + print("Removed breakpoint $bpt1");
|
| + await r1Ref.reload();
|
| + expect(r1Ref.activationBreakpoint, equals(null));
|
| + print("testeeDo()");
|
| + res = await rootLib.evaluate("testeeDo()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(4));
|
| +
|
| + await isolate.removeBreakpoint(bpt2);
|
| + print("Removed breakpoint $bpt2");
|
| + await r2Ref.reload();
|
| + expect(r2Ref.activationBreakpoint, equals(null));
|
| + print("testeeDo()");
|
| + res = await rootLib.evaluate("testeeDo()");
|
| + expect(res is Instance, isTrue); // Not error.
|
| + expect(breaksHit, equals(4));
|
| +
|
| + await cancelFutureSubscription(subscriptionFuture);
|
| +},
|
| +
|
| ];
|
|
|
| main(args) => runIsolateTests(args, tests, testeeBefore: testeeSetup);
|
|
|