Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: runtime/observatory/tests/service/break_on_activation_test.dart

Issue 2759973004: Fix observatory tests broken by running dartfmt. Temporarily reverted formatting for evaluate_activ… (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6291de546a6ae302b8a2f21e79b8873d0ec08396..7169ad48d5a97177e9ef91c668f73c52b1041160 100644
--- a/runtime/observatory/tests/service/break_on_activation_test.dart
+++ b/runtime/observatory/tests/service/break_on_activation_test.dart
@@ -47,162 +47,160 @@ 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);

Powered by Google App Engine
This is Rietveld 408576698