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

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

Issue 1678043003: Add Dart code to diff_view (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup Created 4 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'package:compiler/src/io/source_information.dart'; 8 import 'package:compiler/src/io/source_information.dart';
9 import 'package:compiler/src/js/js_debug.dart'; 9 import 'package:compiler/src/js/js_debug.dart';
10 import 'package:js_ast/js_ast.dart'; 10 import 'package:js_ast/js_ast.dart';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 'invokes': 'tests/compiler/dart2js/sourcemaps/invokes_test_file.dart', 88 'invokes': 'tests/compiler/dart2js/sourcemaps/invokes_test_file.dart',
89 'operators': 'tests/compiler/dart2js/sourcemaps/operators_test_file.dart', 89 'operators': 'tests/compiler/dart2js/sourcemaps/operators_test_file.dart',
90 }; 90 };
91 91
92 Future<TestResult> runTests( 92 Future<TestResult> runTests(
93 String config, 93 String config,
94 String filename, 94 String filename,
95 List<String> options, 95 List<String> options,
96 {bool verbose: true}) async { 96 {bool verbose: true}) async {
97 SourceMapProcessor processor = new SourceMapProcessor(filename); 97 SourceMapProcessor processor = new SourceMapProcessor(filename);
98 List<SourceMapInfo> infoList = await processor.process( 98 SourceMaps sourceMaps = await processor.process(
99 ['--csp', '--disable-inlining'] 99 ['--csp', '--disable-inlining']
100 ..addAll(options), 100 ..addAll(options),
101 verbose: verbose); 101 verbose: verbose);
102 TestResult result = new TestResult(config, filename, processor); 102 TestResult result = new TestResult(config, filename, processor);
103 for (SourceMapInfo info in infoList) { 103 for (SourceMapInfo info in sourceMaps.elementSourceMapInfos.values) {
104 if (info.element.library.isPlatformLibrary) continue; 104 if (info.element.library.isPlatformLibrary) continue;
105 result.userInfoList.add(info); 105 result.userInfoList.add(info);
106 Iterable<CodePoint> missingCodePoints = 106 Iterable<CodePoint> missingCodePoints =
107 info.codePoints.where((c) => c.isMissing); 107 info.codePoints.where((c) => c.isMissing);
108 if (missingCodePoints.isNotEmpty) { 108 if (missingCodePoints.isNotEmpty) {
109 result.missingCodePointsMap[info] = missingCodePoints; 109 result.missingCodePointsMap[info] = missingCodePoints;
110 } 110 }
111 Map<int, Set<SourceLocation>> offsetToLocationsMap = 111 Map<int, Set<SourceLocation>> offsetToLocationsMap =
112 <int, Set<SourceLocation>>{}; 112 <int, Set<SourceLocation>>{};
113 for (Node node in info.nodeMap.nodes) { 113 for (Node node in info.nodeMap.nodes) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void printMultipleOffsets() { 181 void printMultipleOffsets() {
182 multipleOffsetsMap.forEach((info, multipleMap) { 182 multipleOffsetsMap.forEach((info, multipleMap) {
183 multipleMap.forEach((targetOffset, sourceLocations) { 183 multipleMap.forEach((targetOffset, sourceLocations) {
184 print( 184 print(
185 'Multiple source locations:\n ${sourceLocations.join('\n ')}\n' 185 'Multiple source locations:\n ${sourceLocations.join('\n ')}\n'
186 'for offset $targetOffset in ${info.element} in $file.'); 186 'for offset $targetOffset in ${info.element} in $file.');
187 }); 187 });
188 }); 188 });
189 } 189 }
190 } 190 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698