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

Unified Diff: tests/compiler/dart2js/serialization/helper.dart

Issue 2296723003: Handle html+mirrors (Closed)
Patch Set: Created 4 years, 4 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/serialization/helper.dart
diff --git a/tests/compiler/dart2js/serialization/helper.dart b/tests/compiler/dart2js/serialization/helper.dart
index 0c986a1e607f16e28f2f4f53cb7980dc438031eb..9c3204a4a2e5536aee80018d4953abdb12ab753b 100644
--- a/tests/compiler/dart2js/serialization/helper.dart
+++ b/tests/compiler/dart2js/serialization/helper.dart
@@ -213,6 +213,7 @@ Future<List<SerializedData>> preserializeData(
test.preserializedSourceFiles.isEmpty) {
return <SerializedData>[serializedData];
}
+
List<Uri> uriList = <Uri>[];
for (String key in test.preserializedSourceFiles.keys) {
uriList.add(Uri.parse('memory:$key'));
@@ -222,21 +223,33 @@ Future<List<SerializedData>> preserializeData(
if (test.unserializedSourceFiles != null) {
sourceFiles.addAll(test.unserializedSourceFiles);
}
- OutputCollector outputCollector = new OutputCollector();
- Compiler compiler = compilerFor(
- memorySourceFiles: sourceFiles,
- resolutionInputs: serializedData.toUris(),
- options: [Flags.resolveOnly],
- outputProvider: outputCollector);
- compiler.librariesToAnalyzeWhenRun = uriList;
- await compiler.run(null);
- List<LibraryElement> libraries = <LibraryElement>[];
- for (Uri uri in uriList) {
- libraries.add(compiler.libraryLoader.lookupLibrary(uri));
+ Uri additionalDataUri = Uri.parse('memory:additional.data');
+ SerializedData additionalSerializedData;
+ if (test.sourceFiles.isEmpty) {
+ SerializationResult result = await serialize(
+ uriList.first,
+ memorySourceFiles: sourceFiles,
+ resolutionInputs: serializedData.toUris(),
+ dataUri: additionalDataUri);
+ additionalSerializedData = result.serializedData;
+ } else {
+ OutputCollector outputCollector = new OutputCollector();
+ Compiler compiler = compilerFor(
+ entryPoint: test.sourceFiles.isEmpty ? uriList.first : null,
+ memorySourceFiles: sourceFiles,
+ resolutionInputs: serializedData.toUris(),
+ options: [Flags.resolveOnly],
+ outputProvider: outputCollector);
+ compiler.librariesToAnalyzeWhenRun = uriList;
+ await compiler.run(null);
+ List<LibraryElement> libraries = <LibraryElement>[];
+ for (Uri uri in uriList) {
+ libraries.add(compiler.libraryLoader.lookupLibrary(uri));
+ }
+ additionalSerializedData = new SerializedData(
+ additionalDataUri,
+ outputCollector.getOutput('', 'data'));
}
- SerializedData additionalSerializedData = new SerializedData(
- Uri.parse('memory:additional.data'),
- outputCollector.getOutput('', 'data'));
return <SerializedData>[serializedData, additionalSerializedData];
}
« no previous file with comments | « tests/compiler/dart2js/serialization/compilation_test_helper.dart ('k') | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698