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

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

Issue 1196433002: Create and test source mapping for invocations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebased Created 5 years, 5 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:async_helper/async_helper.dart';
6 import 'package:expect/expect.dart';
7 import 'sourcemap_helper.dart';
8 import 'sourcemap_html_helper.dart';
9 import 'package:compiler/src/filenames.dart';
10
11 main(List<String> arguments) {
12 bool showAll = false;
13 Uri outputUri;
14 if (arguments.isNotEmpty) {
15 outputUri = Uri.base.resolve(nativeToUriPath(arguments.last));
16 showAll = arguments.contains('-a');
17 }
18 asyncTest(() async {
19 String filename =
20 'tests/compiler/dart2js/sourcemaps/invokes_test_file.dart';
21 SourceMapProcessor processor = new SourceMapProcessor(filename);
22 List<SourceMapInfo> infoList = await processor.process(
23 ['--use-new-source-info', '--csp', '--disable-inlining']);
24 List<SourceMapInfo> userInfoList = <SourceMapInfo>[];
25 List<SourceMapInfo> failureList = <SourceMapInfo>[];
26 for (SourceMapInfo info in infoList) {
27 if (info.element.library.isPlatformLibrary) continue;
28 userInfoList.add(info);
29 Iterable<CodePoint> missingCodePoints =
30 info.codePoints.where((c) => c.isMissing);
31 if (!missingCodePoints.isEmpty) {
32 print('Missing code points ${missingCodePoints} for '
33 '${info.element} in $filename');
34 failureList.add(info);
35 }
36 }
37 if (failureList.isNotEmpty) {
38 if (outputUri == null) {
39 Expect.fail(
40 "Missing code points found. "
41 "Run the test with a URI option, `source_mapping_test <uri>`, to "
42 "create a html visualization of the missing code points.");
43 } else {
44 createTraceSourceMapHtml(outputUri, processor,
45 showAll ? userInfoList : failureList);
46 }
47 } else if (outputUri != null) {
48 createTraceSourceMapHtml(outputUri, processor, userInfoList);
49 }
50 });
51 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/invokes_test_file.dart ('k') | tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698