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

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

Issue 2768103002: Debugger support for step-into async and async* functions. (Closed)
Patch Set: tweaks and self review Created 3 years, 9 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
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug
5
6 import 'dart:developer';
7 import 'package:observatory/models.dart' as M;
8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart';
10 import 'service_test_common.dart';
11 import 'test_helper.dart';
12
13 const LINE_A = 21;
14 const LINE_B = 22;
15 const LINE_C = 26;
16 const LINE_D = 29;
17 const LINE_E = 35;
18 const LINE_F = 36;
19
20 foobar() async* {
21 yield 1; // LINE_A.
22 yield 2; // LINE_B.
23 }
24
25 helper() async {
26 print('helper'); // LINE_C.
27 await for (var i in foobar()) {
28 debugger();
29 print('loop'); // LINE_D.
30 }
31 }
32
33 testMain() {
34 debugger();
35 print('mmmmm'); // LINE_E.
36 helper(); // LINE_F.
37 }
rmacnak 2017/03/23 20:20:18 Ditto trailing statement
Cutch 2017/03/23 21:24:50 Done.
38
39 var tests = [
40 hasStoppedAtBreakpoint,
41 stoppedAtLine(LINE_E),
42 stepInto,
rmacnak 2017/03/23 20:20:18 over
Cutch 2017/03/23 21:24:50 Done.
43 hasStoppedAtBreakpoint,
44 stoppedAtLine(LINE_F),
45 stepInto,
46 hasStoppedAtBreakpoint,
47 stoppedAtLine(LINE_C),
48 stepInto,
rmacnak 2017/03/23 20:20:18 over
Cutch 2017/03/23 21:24:50 Done.
49 hasStoppedAtBreakpoint,
50 stepInto,
51 hasStoppedAtBreakpoint,
52 stoppedAtLine(LINE_A),
53 // Resume here to exit the generator function.
54 // TODO(johnmccutchan): Implement support for step-out of async functions.
55 resumeIsolate,
56 hasStoppedAtBreakpoint,
57 stoppedAtLine(LINE_D),
58 stepInto,
rmacnak 2017/03/23 20:20:18 over
Cutch 2017/03/23 21:24:50 Done.
59 hasStoppedAtBreakpoint,
60 stepInto,
61 hasStoppedAtBreakpoint,
62 stoppedAtLine(LINE_B),
63 ];
rmacnak 2017/03/23 20:20:18 resumeIsolate to let it cleanly exit
Cutch 2017/03/23 21:24:50 Done.
64
65 main(args) =>
66 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698