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

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

Issue 2930993004: Address additional analysis issues in the observatory codebase. (Closed)
Patch Set: Created 3 years, 6 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 'dart:developer';
7 import 'dart:io';
8
7 import 'service_test_common.dart'; 9 import 'service_test_common.dart';
8 import 'test_helper.dart'; 10 import 'test_helper.dart';
9 import 'dart:developer';
10
11 const int LINE_A = 19;
12 const int LINE_B = 20;
13 const int LINE_C = 21;
14 11
15 foo() async {} 12 foo() async {}
16 13
17 doAsync(stop) async { 14 doAsync(stop) async {
18 if (stop) debugger(); 15 if (stop) debugger();
19 await foo(); // Line A. 16 await foo(); // LINE_A.
20 await foo(); // Line B. 17 await foo(); // LINE_B.
21 await foo(); // Line C. 18 await foo(); // LINE_C.
22 return null; 19 return null;
23 } 20 }
24 21
25 testMain() { 22 testMain() {
26 // With two runs of doAsync floating around, async step should only cause 23 // With two runs of doAsync floating around, async step should only cause
27 // us to stop in the run we started in. 24 // us to stop in the run we started in.
28 doAsync(false); 25 doAsync(false);
29 doAsync(true); 26 doAsync(true);
30 } 27 }
31 28
29 final ScriptLineParser lineParser = new ScriptLineParser(Platform.script);
30
32 var tests = [ 31 var tests = [
33 hasStoppedAtBreakpoint, 32 hasStoppedAtBreakpoint,
34 stoppedAtLine(LINE_A), 33 stoppedAtLine(lineParser.lineFor('LINE_A')),
35 stepOver, // foo() 34 stepOver, // foo()
36 asyncNext, 35 asyncNext,
37 hasStoppedAtBreakpoint, 36 hasStoppedAtBreakpoint,
38 stoppedAtLine(LINE_B), 37 stoppedAtLine(lineParser.lineFor('LINE_B')),
39 stepOver, // foo() 38 stepOver, // foo()
40 asyncNext, 39 asyncNext,
41 hasStoppedAtBreakpoint, 40 hasStoppedAtBreakpoint,
42 stoppedAtLine(LINE_C), 41 stoppedAtLine(lineParser.lineFor('LINE_C')),
43 resumeIsolate, 42 resumeIsolate,
44 ]; 43 ];
45 44
46 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); 45 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698