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

Unified Diff: test/parser_test.dart

Issue 2736983002: Enabling adding and querying for source maps in a MappingBundle. (Closed)
Patch Set: Enabling adding and querying for source maps in a MappingBundle. Created 3 years, 9 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
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/parser_test.dart
diff --git a/test/parser_test.dart b/test/parser_test.dart
index 3cccf441363ff93ce8639b75fd87ed5e80c90b20..2c24d1b6fd0a23d8c1fc581cbb86ce10d8ad692d 100644
--- a/test/parser_test.dart
+++ b/test/parser_test.dart
@@ -262,6 +262,29 @@ main() {
Uri.parse("file:///path/to/pkg/input3.dart"));
});
+ test('build bundle incrementally', () {
+ var mapping = new MappingBundle();
+
+ mapping.addMapping(parseJson(MAP_WITH_SOURCE_LOCATION_AND_NAME_1,
+ mapUrl: "file:///path/to/map"));
+ expect(mapping.spanFor(0, 0, uri: "output.dart").sourceUrl,
+ Uri.parse("file:///path/to/pkg/input1.dart"));
+
+ expect(mapping.containsMapping("output2.dart"), isFalse);
+ mapping.addMapping(parseJson(MAP_WITH_SOURCE_LOCATION_AND_NAME_2,
+ mapUrl: "file:///path/to/map"));
+ expect(mapping.containsMapping("output2.dart"), isTrue);
+ expect(mapping.spanFor(0, 0, uri: "output2.dart").sourceUrl,
+ Uri.parse("file:///path/to/pkg/input2.dart"));
+
+ expect(mapping.containsMapping("3/output.dart"), isFalse);
+ mapping.addMapping(parseJson(MAP_WITH_SOURCE_LOCATION_AND_NAME_3,
+ mapUrl: "file:///path/to/map"));
+ expect(mapping.containsMapping("3/output.dart"), isTrue);
+ expect(mapping.spanFor(0, 0, uri: "3/output.dart").sourceUrl,
+ Uri.parse("file:///path/to/pkg/input3.dart"));
+ });
+
// Test that the source map can handle cases where the uri passed in is
// not from the expected host but it is still unambiguous which source
// map should be used.
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698