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

Unified Diff: tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart

Issue 221663005: Load deferred chunks in the right order. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « sdk/lib/async/deferred_load.dart ('k') | tests/compiler/dart2js_extra/deferred/deferred_class_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
index 20a663c3b726d637e4a443aa54dda1e3f3c65e12..88a56807aec6b2f7c005e93d48934c2de6e48266 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
@@ -67,24 +67,36 @@ void main() {
.contains(inputElement));
var hunksToLoad = compiler.deferredLoadTask.hunksToLoad;
- var hunksLib1 = new Set.from(hunksToLoad["lib1"].map((o) => o.name));
- var hunksLib2 = new Set.from(hunksToLoad["lib2"].map((o) => o.name));
- var hunksLib4_1 = new Set.from(hunksToLoad["lib4_1"].map((o) => o.name));
- var hunksLib4_2 = new Set.from(hunksToLoad["lib4_2"].map((o) => o.name));
+
+ mapToNames(id) {
+ return hunksToLoad[id].map((l) {
+ return new Set.from(l.map((o) => o.name));
+ }).toList();
+ }
+
+ var hunksLib1 = mapToNames("lib1");
+ var hunksLib2 = mapToNames("lib2");
+ var hunksLib4_1 = mapToNames("lib4_1");
+ var hunksLib4_2 = mapToNames("lib4_2");
Expect.equals(hunksLib1.length, 2);
- Expect.isTrue(hunksLib1.contains("lib1"));
- Expect.isTrue(hunksLib1.contains("lib1_lib2") ||
- hunksLib1.contains("lib2_lib1"));
- Expect.isTrue(hunksLib2.contains("lib2"));
+ Expect.equals(hunksLib1[0].length, 1);
+ Expect.equals(hunksLib1[1].length, 1);
+ Expect.isTrue(hunksLib1[0].contains("lib1_lib2") ||
+ hunksLib1[0].contains("lib2_lib1"));
+ Expect.isTrue(hunksLib1[1].contains("lib1"));
Expect.equals(hunksLib2.length, 2);
- Expect.isTrue(hunksLib2.contains("lib1_lib2") ||
- hunksLib1.contains("lib2_lib1"));
- Expect.isTrue(hunksLib4_1.contains("lib4_1"));
+ Expect.equals(hunksLib2[0].length, 1);
+ Expect.equals(hunksLib2[1].length, 1);
+ Expect.isTrue(hunksLib2[0].contains("lib1_lib2") ||
+ hunksLib2[0].contains("lib2_lib1"));
+ Expect.isTrue(hunksLib2[1].contains("lib2"));
Expect.equals(hunksLib4_1.length, 1);
- Expect.isTrue(hunksLib4_2.contains("lib4_2"));
+ Expect.equals(hunksLib4_1[0].length, 1);
+ Expect.isTrue(hunksLib4_1[0].contains("lib4_1"));
Expect.equals(hunksLib4_2.length, 1);
+ Expect.equals(hunksLib4_2[0].length, 1);
+ Expect.isTrue(hunksLib4_2[0].contains("lib4_2"));
Expect.equals(hunksToLoad["main"], null);
-
}));
}
« no previous file with comments | « sdk/lib/async/deferred_load.dart ('k') | tests/compiler/dart2js_extra/deferred/deferred_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698