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

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

Issue 2294883004: Don't return negative token positions in stack traces. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | runtime/observatory/tests/service/service_test_common.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, 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 helper() async { // Line 12, Col 16 is the open brace.
13 }
14
15 testMain() {
16 debugger();
17 helper(); // Line 17, Col 3 is the position of the function call.
18 }
19
20 var tests = [
21 hasStoppedAtBreakpoint,
22 stoppedAtLine(17),
23 stepInto,
24
25 (Isolate isolate) async {
26 ServiceMap stack = await isolate.getStack();
27 expect(stack['frames'].length, greaterThan(3));
28
29 var frame = stack['frames'][0];
30 expect(frame.function.name, equals('Completer.sync'));
31 expect(await frame.location.getLine(), greaterThan(0));
32 expect(await frame.location.getColumn(), greaterThan(0));
33
34 // We used to return a negative token position for this frame.
35 // See issue #27128.
36 frame = stack['frames'][1];
37 expect(frame.function.name, equals('helper'));
38 expect(await frame.location.getLine(), equals(12));
39 expect(await frame.location.getColumn(), equals(16));
40
41 frame = stack['frames'][2];
42 expect(frame.function.name, equals('testMain'));
43 expect(await frame.location.getLine(), equals(17));
44 expect(await frame.location.getColumn(), equals(3));
45 }
46 ];
47
48 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/tests/service/service_test_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698