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

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

Issue 2694213002: Revert "Improvements to causal async stack traces" (Closed)
Patch Set: 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
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 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 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 'dart:developer'; 6 import 'dart:developer';
7 import 'package:observatory/models.dart' as M; 7 import 'package:observatory/models.dart' as M;
8 import 'package:observatory/service_io.dart'; 8 import 'package:observatory/service_io.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'service_test_common.dart'; 10 import 'service_test_common.dart';
(...skipping 29 matching lines...) Expand all
40 }, 40 },
41 resumeIsolate, 41 resumeIsolate,
42 hasStoppedAtBreakpoint, 42 hasStoppedAtBreakpoint,
43 stoppedAtLine(LINE_A), 43 stoppedAtLine(LINE_A),
44 44
45 (Isolate isolate) async { 45 (Isolate isolate) async {
46 ServiceMap stack = await isolate.getStack(); 46 ServiceMap stack = await isolate.getStack();
47 // Has causal frames (we are inside an async function) 47 // Has causal frames (we are inside an async function)
48 expect(stack['asyncCausalFrames'], isNotNull); 48 expect(stack['asyncCausalFrames'], isNotNull);
49 var asyncStack = stack['asyncCausalFrames']; 49 var asyncStack = stack['asyncCausalFrames'];
50 expect(asyncStack[0].toString(), contains('helper')); 50 expect(asyncStack[0].toString(), contains('helper_async_body'));
51 expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker)); 51 expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker));
52 expect(asyncStack[2].toString(), contains('testMain')); 52 expect(asyncStack[2].toString(), contains('helper'));
53 expect(asyncStack[3].toString(), contains('testMain'));
53 }, 54 },
54 55
55 resumeIsolate, 56 resumeIsolate,
56 hasStoppedAtBreakpoint, 57 hasStoppedAtBreakpoint,
57 stoppedAtLine(LINE_C), 58 stoppedAtLine(LINE_C),
58 59
59 (Isolate isolate) async { 60 (Isolate isolate) async {
60 ServiceMap stack = await isolate.getStack(); 61 ServiceMap stack = await isolate.getStack();
61 // Has causal frames (we are inside a function called by an async function) 62 // Has causal frames (we are inside a function called by an async function)
62 expect(stack['asyncCausalFrames'], isNotNull); 63 expect(stack['asyncCausalFrames'], isNotNull);
63 var asyncStack = stack['asyncCausalFrames']; 64 var asyncStack = stack['asyncCausalFrames'];
64 expect(asyncStack[0].toString(), contains('foobar')); 65 expect(asyncStack[0].toString(), contains('foobar'));
65 expect(asyncStack[1].toString(), contains('helper')); 66 expect(asyncStack[1].toString(), contains('helper_async_body'));
66 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker)); 67 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker));
67 expect(asyncStack[3].toString(), contains('testMain')); 68 expect(asyncStack[3].toString(), contains('helper'));
68 }, 69 },
69 ]; 70 ];
70 71
71 main(args) => runIsolateTestsSynchronous(args, 72 main(args) => runIsolateTestsSynchronous(args,
72 tests, 73 tests,
73 testeeConcurrent: testMain); 74 testeeConcurrent: testMain);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698