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

Unified Diff: tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart

Issue 2690083002: Add MultiSourceInformationStrategy (Closed)
Patch Set: Cleanup. 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
diff --git a/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..47740b305f4ed28701ae9cbb5062d0bcae902a27
--- /dev/null
+++ b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2017, 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 'dart:async';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/compiler_new.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:expect/expect.dart';
+import '../memory_compiler.dart';
+
+main() {
+ asyncTest(() async {
+ String oldMap = (await compile([])).getOutput('', OutputType.js_map);
+ String newMap = (await compile([Flags.useNewSourceInfo]))
+ .getOutput('', OutputType.js_map);
+ OutputCollector multiCollector1 = await compile([Flags.useMultiSourceInfo]);
+ String multiMap1a = multiCollector1.getOutput('', OutputType.js_map);
+ String multiMap1b = multiCollector1.getOutput('out.js', OutputType.js_map);
+ Expect.equals(oldMap, multiMap1a);
+ Expect.equals(newMap, multiMap1b);
+ OutputCollector multiCollector2 =
+ await compile([Flags.useMultiSourceInfo, Flags.useNewSourceInfo]);
+ String multiMap2a = multiCollector2.getOutput('', OutputType.js_map);
+ String multiMap2b = multiCollector2.getOutput('out.js', OutputType.js_map);
+ Expect.equals(newMap, multiMap2a);
+ Expect.equals(oldMap, multiMap2b);
+ });
+}
+
+Future<OutputCollector> compile(List<String> options) async {
+ OutputCollector collector = new OutputCollector();
+ await runCompiler(
+ entryPoint: Uri.parse('memory:main.dart'),
+ memorySourceFiles: const {'main.dart': 'main() {}'},
+ outputProvider: collector,
+ options: options);
+ return collector;
+}
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/js_tracer.dart ('k') | tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698