| Index: runtime/observatory/tests/service/evaluate_activation_test.dart
|
| diff --git a/runtime/observatory/tests/service/evaluate_activation_test.dart b/runtime/observatory/tests/service/evaluate_activation_test.dart
|
| index eb24a0ebd9cc258ecc465a1a299839d172e3d159..4bb8c7627f623f4f9af661a7c94f6cddbd939000 100644
|
| --- a/runtime/observatory/tests/service/evaluate_activation_test.dart
|
| +++ b/runtime/observatory/tests/service/evaluate_activation_test.dart
|
| @@ -75,7 +75,7 @@ testMethod(Isolate isolate) async {
|
| rootLib.functions.singleWhere((f) => f.name == 'breakHere');
|
| Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
|
| print("Breakpoint: $bpt");
|
| - expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
| + expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
|
|
| bool hitBreakpoint = false;
|
| var stream = await isolate.vm.getEventStream(VM.kDebugStream);
|
| @@ -84,31 +84,75 @@ testMethod(Isolate isolate) async {
|
| print("Event $event");
|
| if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| var frameNumber = 1, r;
|
| - r = await isolate.evalFrame(frameNumber, '123'); /// instance: ok
|
| - expect(r.valueAsString, equals('123')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'this'); /// scope: ok
|
| - expect(r.clazz.name, equals('C')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'instVar'); /// instance: continued
|
| - expect(r.valueAsString, equals('1')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'classVar'); /// instance: continued
|
| - expect(r.valueAsString, equals('2')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'methodParam'); /// scope: continued
|
| - expect(r.valueAsString, equals('3')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'methodTemp'); /// scope: continued
|
| - expect(r.valueAsString, equals('4')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'outerParam'); /// scope: continued
|
| - expect(r.valueAsString, equals('5')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'outerTemp'); /// scope: continued
|
| - expect(r.valueAsString, equals('6')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'innerParam'); /// instance: continued
|
| - expect(r.valueAsString, equals('7')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'innerTemp'); /// instance: continued
|
| - expect(r.valueAsString, equals('8')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'math.sqrt'); /// instance: continued
|
| - expect(r.isClosure, isTrue); /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, '123');
|
| +
|
| + /// instance: ok
|
| + expect(r.valueAsString, equals('123'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'this');
|
| +
|
| + /// scope: ok
|
| + expect(r.clazz.name, equals('C'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'instVar');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('1'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'classVar');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('2'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'methodParam');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('3'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'methodTemp');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('4'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'outerParam');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('5'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'outerTemp');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('6'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'innerParam');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('7'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'innerTemp');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('8'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'math.sqrt');
|
| +
|
| + /// instance: continued
|
| + expect(r.isClosure, isTrue);
|
| +
|
| + /// instance: continued
|
|
|
| hitBreakpoint = true;
|
| - sub.cancel(); // Do not handle events for the other tests.
|
| + sub.cancel(); // Do not handle events for the other tests.
|
| isolate.resume();
|
| }
|
| });
|
| @@ -124,7 +168,7 @@ testMethod2(Isolate isolate) async {
|
| rootLib.functions.singleWhere((f) => f.name == 'breakHere');
|
| Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
|
| print("Breakpoint: $bpt");
|
| - expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
| + expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
|
|
| bool hitBreakpoint = false;
|
| var stream = await isolate.vm.getEventStream(VM.kDebugStream);
|
| @@ -142,13 +186,21 @@ testMethod2(Isolate isolate) async {
|
| r = await isolate.evalFrame(frameNumber, 'classVar');
|
| expect(r.valueAsString, equals('2'));
|
| r = await isolate.evalFrame(frameNumber, 'methodParam');
|
| - expect(r.valueAsString, equals('3')); /// scope: continued
|
| + expect(r.valueAsString, equals('3'));
|
| +
|
| + /// scope: continued
|
| r = await isolate.evalFrame(frameNumber, 'methodTemp');
|
| - expect(r.valueAsString, equals('4')); /// scope: continued
|
| + expect(r.valueAsString, equals('4'));
|
| +
|
| + /// scope: continued
|
| r = await isolate.evalFrame(frameNumber, 'outerParam');
|
| - expect(r.valueAsString, equals('5')); /// scope: continued
|
| + expect(r.valueAsString, equals('5'));
|
| +
|
| + /// scope: continued
|
| r = await isolate.evalFrame(frameNumber, 'outerTemp');
|
| - expect(r.valueAsString, equals('6')); /// scope: continued
|
| + expect(r.valueAsString, equals('6'));
|
| +
|
| + /// scope: continued
|
| r = await isolate.evalFrame(frameNumber, 'innerParam');
|
| expect(r.valueAsString, equals('7'));
|
| r = await isolate.evalFrame(frameNumber, 'innerTemp');
|
| @@ -157,7 +209,7 @@ testMethod2(Isolate isolate) async {
|
| expect(r.isClosure, isTrue);
|
|
|
| hitBreakpoint = true;
|
| - sub.cancel(); // Do not handle events for the other tests.
|
| + sub.cancel(); // Do not handle events for the other tests.
|
| isolate.resume();
|
| }
|
| });
|
| @@ -173,7 +225,7 @@ testMethod3(Isolate isolate) async {
|
| rootLib.functions.singleWhere((f) => f.name == 'breakHere');
|
| Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
|
| print("Breakpoint: $bpt");
|
| - expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
| + expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
|
|
| bool hitBreakpoint = false;
|
| var stream = await isolate.vm.getEventStream(VM.kDebugStream);
|
| @@ -198,7 +250,7 @@ testMethod3(Isolate isolate) async {
|
| expect(r.isClosure, isTrue);
|
|
|
| hitBreakpoint = true;
|
| - sub.cancel(); // Do not handle events for the other tests.
|
| + sub.cancel(); // Do not handle events for the other tests.
|
| isolate.resume();
|
| }
|
| });
|
| @@ -208,14 +260,13 @@ testMethod3(Isolate isolate) async {
|
| expect(hitBreakpoint, isTrue);
|
| }
|
|
|
| -
|
| testMethod4(Isolate isolate) async {
|
| Library rootLib = await isolate.rootLibrary.load();
|
| ServiceFunction function =
|
| rootLib.functions.singleWhere((f) => f.name == 'breakHere');
|
| Breakpoint bpt = await isolate.addBreakpointAtEntry(function);
|
| print("Breakpoint: $bpt");
|
| - expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
| + expect(bpt is Breakpoint, isTrue); // I.e, not null.
|
|
|
| bool hitBreakpoint = false;
|
| var stream = await isolate.vm.getEventStream(VM.kDebugStream);
|
| @@ -224,37 +275,81 @@ testMethod4(Isolate isolate) async {
|
| print("Event $event");
|
| if (event.kind == ServiceEvent.kPauseBreakpoint) {
|
| var frameNumber = 1, r;
|
| - r = await isolate.evalFrame(frameNumber, '123'); /// instance: continued
|
| - expect(r.valueAsString, equals('123')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'this'); /// scope: continued
|
| - expect(r.clazz.name, equals('C')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'instVar'); /// instance: continued
|
| - expect(r.valueAsString, equals('1')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'classVar'); /// instance: continued
|
| - expect(r.valueAsString, equals('2')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'methodParam'); /// scope: continued
|
| - expect(r.valueAsString, equals('3')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'methodTemp'); /// scope: continued
|
| - expect(r.valueAsString, equals('4')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'outerParam'); /// scope: continued
|
| - expect(r.valueAsString, equals('5')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'outerTemp'); /// scope: continued
|
| - expect(r.valueAsString, equals('6')); /// scope: continued
|
| - r = await isolate.evalFrame(frameNumber, 'innerParam'); /// instance: continued
|
| - expect(r.valueAsString, equals('7')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'innerTemp'); /// instance: continued
|
| - expect(r.valueAsString, equals('8')); /// instance: continued
|
| - r = await isolate.evalFrame(frameNumber, 'math.sqrt'); /// instance: continued
|
| - expect(r.isClosure, isTrue); /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, '123');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('123'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'this');
|
| +
|
| + /// scope: continued
|
| + expect(r.clazz.name, equals('C'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'instVar');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('1'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'classVar');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('2'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'methodParam');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('3'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'methodTemp');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('4'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'outerParam');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('5'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'outerTemp');
|
| +
|
| + /// scope: continued
|
| + expect(r.valueAsString, equals('6'));
|
| +
|
| + /// scope: continued
|
| + r = await isolate.evalFrame(frameNumber, 'innerParam');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('7'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'innerTemp');
|
| +
|
| + /// instance: continued
|
| + expect(r.valueAsString, equals('8'));
|
| +
|
| + /// instance: continued
|
| + r = await isolate.evalFrame(frameNumber, 'math.sqrt');
|
| +
|
| + /// instance: continued
|
| + expect(r.isClosure, isTrue);
|
| +
|
| + /// instance: continued
|
|
|
| hitBreakpoint = true;
|
| - sub.cancel(); // Do not handle events for the other tests.
|
| + sub.cancel(); // Do not handle events for the other tests.
|
| isolate.resume();
|
| }
|
| });
|
|
|
| - var result = await rootLib.evaluate(
|
| - '(){ new C().method4(3); C.closureWithReturnedHome(7); }()');
|
| + var result = await rootLib
|
| + .evaluate('(){ new C().method4(3); C.closureWithReturnedHome(7); }()');
|
| print("Result $result");
|
| expect(hitBreakpoint, isTrue);
|
| }
|
|
|