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

Side by Side Diff: tests/compiler/dart2js/sourcemaps/stacktrace_test.dart

Issue 2667983002: Add test for expected source mappings (Closed)
Patch Set: Update comment. 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 | « tests/compiler/dart2js/sourcemaps/mapping_test.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 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 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 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:async_helper/async_helper.dart'; 9 import 'package:async_helper/async_helper.dart';
10 import 'package:compiler/compiler_new.dart'; 10 import 'package:compiler/compiler_new.dart';
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 ]; 202 ];
203 203
204 class Test { 204 class Test {
205 final String code; 205 final String code;
206 final List<StackTraceLine> expectedLines; 206 final List<StackTraceLine> expectedLines;
207 final List<StackTraceLine> unexpectedLines; 207 final List<StackTraceLine> unexpectedLines;
208 208
209 Test(this.code, this.expectedLines, this.unexpectedLines); 209 Test(this.code, this.expectedLines, this.unexpectedLines);
210 } 210 }
211 211
212 const int _LF = 0x0A;
213 const int _CR = 0x0D;
214 const int _LBRACE = 0x7B;
215
216 Test processTestCode(String code) { 212 Test processTestCode(String code) {
217 Map<int, StackTraceLine> stackTraceMap = <int, StackTraceLine>{}; 213 Map<int, StackTraceLine> stackTraceMap = <int, StackTraceLine>{};
218 List<StackTraceLine> unexpectedLines = <StackTraceLine>[]; 214 List<StackTraceLine> unexpectedLines = <StackTraceLine>[];
219 AnnotatedCode annotatedCode = new AnnotatedCode(code); 215 AnnotatedCode annotatedCode = new AnnotatedCode.fromText(code);
220 for (Annotation annotation in annotatedCode.annotations) { 216 for (Annotation annotation in annotatedCode.annotations) {
221 int colonIndex = annotation.text.indexOf(':'); 217 int colonIndex = annotation.text.indexOf(':');
222 String indexText = annotation.text.substring(0, colonIndex); 218 String indexText = annotation.text.substring(0, colonIndex);
223 String methodName = annotation.text.substring(colonIndex + 1); 219 String methodName = annotation.text.substring(colonIndex + 1);
224 StackTraceLine stackTraceLine = new StackTraceLine( 220 StackTraceLine stackTraceLine = new StackTraceLine(
225 methodName, INPUT_FILE_NAME, annotation.lineNo, annotation.columnNo); 221 methodName, INPUT_FILE_NAME, annotation.lineNo, annotation.columnNo);
226 if (indexText == '') { 222 if (indexText == '') {
227 unexpectedLines.add(stackTraceLine); 223 unexpectedLines.add(stackTraceLine);
228 } else { 224 } else {
229 int stackTraceIndex = int.parse(indexText); 225 int stackTraceIndex = int.parse(indexText);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 const LineException( 550 const LineException(
555 '_awaitOnObject.<anonymous function>', 'async_patch.dart'), 551 '_awaitOnObject.<anonymous function>', 'async_patch.dart'),
556 const LineException('_RootZone.runUnary', 'zone.dart'), 552 const LineException('_RootZone.runUnary', 'zone.dart'),
557 const LineException('_FutureListener.handleValue', 'future_impl.dart'), 553 const LineException('_FutureListener.handleValue', 'future_impl.dart'),
558 const LineException( 554 const LineException(
559 '_Future._propagateToListeners.handleValueCallback', 'future_impl.dart'), 555 '_Future._propagateToListeners.handleValueCallback', 'future_impl.dart'),
560 const LineException('_Future._propagateToListeners', 'future_impl.dart'), 556 const LineException('_Future._propagateToListeners', 'future_impl.dart'),
561 const LineException( 557 const LineException(
562 '_Future._addListener.<anonymous function>', 'future_impl.dart'), 558 '_Future._addListener.<anonymous function>', 'future_impl.dart'),
563 ]; 559 ];
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/mapping_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698