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

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

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: rebase Created 3 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
(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/service_io.dart';
8 import 'package:unittest/unittest.dart';
9 import 'service_test_common.dart';
10 import 'test_helper.dart';
11
12 const LINE_A = 25;
13 const LINE_B = 18;
14 const LINE_C = 20;
15
16 foobar() async* {
17 debugger();
18 yield 1; // LINE_B.
19 debugger();
20 yield 2; // LINE_C.
21 }
22
23 helper() async {
24 debugger();
25 print('helper'); // LINE_A.
26 await for (var i in foobar()) {
27 print('helper $i');
28 }
29 }
30
31 testMain() {
32 helper();
33 }
34
35 var tests = [
36 hasStoppedAtBreakpoint,
37 stoppedAtLine(LINE_A),
38 (Isolate isolate) async {
39 ServiceMap stack = await isolate.getStack();
40 // No causal frames because we are in a completely synchronous stack.
41 expect(stack['asyncCausalFrames'], isNotNull);
42 },
43 resumeIsolate,
44 hasStoppedAtBreakpoint,
45 stoppedAtLine(LINE_B),
46
47 (Isolate isolate) async {
48 ServiceMap stack = await isolate.getStack();
49 // Has causal frames (we are inside an async function)
50 expect(stack['asyncCausalFrames'], isNotNull);
51 },
52
53 resumeIsolate,
54 hasStoppedAtBreakpoint,
55 stoppedAtLine(LINE_C),
56
57 (Isolate isolate) async {
58 ServiceMap stack = await isolate.getStack();
59 // Has causal frames (we are inside a function called by an async function)
60 expect(stack['asyncCausalFrames'], isNotNull);
61 },
62 ];
63
64 main(args) => runIsolateTestsSynchronous(args,
65 tests,
66 testeeConcurrent: testMain);
OLDNEW
« no previous file with comments | « runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698