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

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

Issue 2694013003: Add tests of line numbers to causal async stack tests (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
« no previous file with comments | « no previous file | runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 (Isolate isolate) async { 59 (Isolate isolate) async {
60 ServiceMap stack = await isolate.getStack(); 60 ServiceMap stack = await isolate.getStack();
61 // Has causal frames (we are inside a function called by an async function) 61 // Has causal frames (we are inside a function called by an async function)
62 expect(stack['asyncCausalFrames'], isNotNull); 62 expect(stack['asyncCausalFrames'], isNotNull);
63 var asyncStack = stack['asyncCausalFrames']; 63 var asyncStack = stack['asyncCausalFrames'];
64 expect(asyncStack[0].toString(), contains('foobar')); 64 expect(asyncStack[0].toString(), contains('foobar'));
65 expect(asyncStack[1].toString(), contains('helper')); 65 expect(asyncStack[1].toString(), contains('helper'));
66 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker)); 66 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker));
67 expect(asyncStack[3].toString(), contains('testMain')); 67 expect(asyncStack[3].toString(), contains('testMain'));
68 // Line 19.
69 expect(await asyncStack[0].location.toUserString(), contains(':19:'));
hausner 2017/02/15 08:36:54 DBC: you could use string interpolation to avoid t
70 // Line 25.
71 expect(await asyncStack[1].location.toUserString(), contains(':25:'));
72 // Line 30.
73 expect(await asyncStack[3].location.toUserString(), contains(':30:'));
68 }, 74 },
69 ]; 75 ];
70 76
71 main(args) => runIsolateTestsSynchronous(args, 77 main(args) => runIsolateTestsSynchronous(args,
72 tests, 78 tests,
73 testeeConcurrent: testMain); 79 testeeConcurrent: testMain);
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/tests/service/causal_async_star_stack_contents_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698