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

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

Issue 2304463002: Converted Observatory vm-view && isolate-view elements (Closed)
Patch Set: Fixed typo Created 4 years, 3 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/models.dart' as M;
6 import 'package:observatory/service_io.dart'; 7 import 'package:observatory/service_io.dart';
7 import 'test_helper.dart'; 8 import 'test_helper.dart';
8 import 'dart:async'; 9 import 'dart:async';
9 import 'dart:developer'; 10 import 'dart:developer';
10 import 'service_test_common.dart'; 11 import 'service_test_common.dart';
11 12
12 const int LINE_A = 19; 13 const int LINE_A = 20;
13 14
14 foo() async { } 15 foo() async { }
15 bar() { } 16 bar() { }
16 17
17 doAsync(stop) async { 18 doAsync(stop) async {
18 if (stop) debugger(); 19 if (stop) debugger();
19 await foo(); // Line A. 20 await foo(); // Line A.
20 bar(); // Line A + 1. 21 bar(); // Line A + 1.
21 bar(); // Line A + 2. 22 bar(); // Line A + 2.
22 await foo(); // Line A + 3. 23 await foo(); // Line A + 3.
(...skipping 18 matching lines...) Expand all
41 subscription.cancel(); 42 subscription.cancel();
42 completer.complete(); 43 completer.complete();
43 } 44 }
44 }); 45 });
45 }); 46 });
46 isolate.stepOver(); 47 isolate.stepOver();
47 return completer.future; 48 return completer.future;
48 } 49 }
49 50
50 smartNext(Isolate isolate) async { 51 smartNext(Isolate isolate) async {
51 if (isolate.pauseEvent.atAsyncSuspension) { 52 if (M.isAtAsyncSuspension(isolate.pauseEvent)) {
52 print("next-async"); 53 print("next-async");
53 return asyncStepOver(isolate); 54 return asyncStepOver(isolate);
54 } else { 55 } else {
55 print("next-sync"); 56 print("next-sync");
56 return stepOverAwaitingResume(isolate); 57 return stepOverAwaitingResume(isolate);
57 } 58 }
58 } 59 }
59 60
60 var tests = [ 61 var tests = [
61 hasStoppedAtBreakpoint, stoppedAtLine(LINE_A), // foo() 62 hasStoppedAtBreakpoint, stoppedAtLine(LINE_A), // foo()
62 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A), // await 63 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A), // await
63 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 1), // bar() 64 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 1), // bar()
64 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 2), // bar() 65 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 2), // bar()
65 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 3), // foo() 66 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 3), // foo()
66 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 3), // await 67 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 3), // await
67 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 4), // foo() 68 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 4), // foo()
68 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 4), // await 69 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 4), // await
69 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 5), // bar() 70 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 5), // bar()
70 resumeIsolate, 71 resumeIsolate,
71 ]; 72 ];
72 73
73 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); 74 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698