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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/sourcemaps/source_mapping_test.dart
diff --git a/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart b/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..831299fe23e3c0ca5abf801bb2791c73dd9c42b4
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/source_mapping_test.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+import 'sourcemap_helper.dart';
+import 'sourcemap_html_helper.dart';
+import 'package:compiler/src/filenames.dart';
+
+main(List<String> arguments) {
+ bool showAll = false;
+ Uri outputUri;
+ if (arguments.isNotEmpty) {
+ outputUri = Uri.base.resolve(nativeToUriPath(arguments.last));
+ showAll = arguments.contains('-a');
+ }
+ asyncTest(() async {
+ String filename =
+ 'tests/compiler/dart2js/sourcemaps/invokes_test_file.dart';
+ SourceMapProcessor processor = new SourceMapProcessor(filename);
+ List<SourceMapInfo> infoList = await processor.process(
+ ['--use-new-source-info', '--csp', '--disable-inlining']);
+ List<SourceMapInfo> userInfoList = <SourceMapInfo>[];
+ List<SourceMapInfo> failureList = <SourceMapInfo>[];
+ for (SourceMapInfo info in infoList) {
+ if (info.element.library.isPlatformLibrary) continue;
+ userInfoList.add(info);
+ Iterable<CodePoint> missingCodePoints =
+ info.codePoints.where((c) => c.isMissing);
+ if (!missingCodePoints.isEmpty) {
+ print('Missing code points ${missingCodePoints} for '
+ '${info.element} in $filename');
+ failureList.add(info);
+ }
+ }
+ if (failureList.isNotEmpty) {
+ if (outputUri == null) {
+ Expect.fail(
+ "Missing code points found. "
+ "Run the test with a URI option, `source_mapping_test <uri>`, to "
+ "create a html visualization of the missing code points.");
+ } else {
+ createTraceSourceMapHtml(outputUri, processor,
+ showAll ? userInfoList : failureList);
+ }
+ } else if (outputUri != null) {
+ createTraceSourceMapHtml(outputUri, processor, userInfoList);
+ }
+ });
+}
« 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