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

Side by Side Diff: runtime/observatory/tests/service/smart_next_test.dart

Issue 1699153002: Add step OverAwait to service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // VMOptions=--error_on_bad_type --error_on_bad_override 4 // VMOptions=--error_on_bad_type --error_on_bad_override
5 5
6 import 'package:observatory/service_io.dart'; 6 import 'package:observatory/service_io.dart';
7 import 'test_helper.dart'; 7 import 'test_helper.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:developer'; 9 import 'dart:developer';
10 10
(...skipping 27 matching lines...) Expand all
38 subscription.cancel(); 38 subscription.cancel();
39 completer.complete(); 39 completer.complete();
40 } 40 }
41 }); 41 });
42 }); 42 });
43 isolate.stepOver(); 43 isolate.stepOver();
44 return completer.future; 44 return completer.future;
45 } 45 }
46 46
47 smartNext(Isolate isolate) async { 47 smartNext(Isolate isolate) async {
48 if (isolate.pauseEvent.atAsyncJump) { 48 if (isolate.pauseEvent.atAsyncSuspension) {
49 print("next-async"); 49 print("next-async");
50 List asyncStepFutures = await isolate.asyncStepOver(); 50 return asyncStepOver(isolate);
51 return asyncStepFutures[Isolate.kSecondResume];
52 } else { 51 } else {
53 print("next-sync"); 52 print("next-sync");
54 return stepOverAwaitingResume(isolate); 53 return stepOverAwaitingResume(isolate);
55 } 54 }
56 } 55 }
57 56
58 var tests = [ 57 var tests = [
59 hasStoppedAtBreakpoint, stoppedAtLine(16), // foo() 58 hasStoppedAtBreakpoint, stoppedAtLine(16), // foo()
60 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(16), // await 59 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(16), // await
61 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(17), // bar() 60 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(17), // bar()
62 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(18), // bar() 61 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(18), // bar()
63 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // foo() 62 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // foo()
64 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // await 63 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // await
65 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // foo() 64 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // foo()
66 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // await 65 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // await
67 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(21), // bar() 66 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(21), // bar()
68 resumeIsolate, 67 resumeIsolate,
69 ]; 68 ];
70 69
71 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); 70 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698