OLD | NEW |
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 Loading... |
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); |
OLD | NEW |