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

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

Issue 1726773002: Refactor service tests in preparation of running on sky_shell (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 --verbose_debug 4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug
5 5
6 import 'package:observatory/service_io.dart'; 6 import 'package:observatory/service_io.dart';
7 import 'service_test_common.dart';
7 import 'test_helper.dart'; 8 import 'test_helper.dart';
8 import 'dart:developer'; 9 import 'dart:developer';
9 10
11 const int LINE_A = 19;
12 const int LINE_B = 20;
13 const int LINE_C = 21;
14
10 foo() async { } 15 foo() async { }
11 16
12 doAsync(stop) async { 17 doAsync(stop) async {
13 if (stop) debugger(); 18 if (stop) debugger();
14 await foo(); // Line 14. 19 await foo(); // Line A.
15 await foo(); // Line 15. 20 await foo(); // Line B.
16 await foo(); // Line 16. 21 await foo(); // Line C.
17 return null; 22 return null;
18 } 23 }
19 24
20 testMain() { 25 testMain() {
21 // With two runs of doAsync floating around, async step should only cause 26 // With two runs of doAsync floating around, async step should only cause
22 // us to stop in the run we started in. 27 // us to stop in the run we started in.
23 doAsync(false); 28 doAsync(false);
24 doAsync(true); 29 doAsync(true);
25 } 30 }
26 31
27 asyncNext(Isolate isolate) async { 32 asyncNext(Isolate isolate) async {
28 print('asyncNext'); 33 print('asyncNext');
29 return asyncStepOver(isolate); 34 return asyncStepOver(isolate);
30 } 35 }
31 36
32 var tests = [ 37 var tests = [
33 hasStoppedAtBreakpoint, 38 hasStoppedAtBreakpoint,
34 stoppedAtLine(14), 39 stoppedAtLine(LINE_A),
35 stepOver, // foo() 40 stepOver, // foo()
36 asyncNext, 41 asyncNext,
37 hasStoppedAtBreakpoint, 42 hasStoppedAtBreakpoint,
38 stoppedAtLine(15), 43 stoppedAtLine(LINE_B),
39 stepOver, // foo() 44 stepOver, // foo()
40 asyncNext, 45 asyncNext,
41 hasStoppedAtBreakpoint, 46 hasStoppedAtBreakpoint,
42 stoppedAtLine(16), 47 stoppedAtLine(LINE_C),
43 resumeIsolate, 48 resumeIsolate,
44 ]; 49 ];
45 50
46 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); 51 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698