| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test of the graph segmentation algorithm used by deferred loading | 5 // Test of the graph segmentation algorithm used by deferred loading |
| 6 // to determine which elements can be deferred and which libraries | 6 // to determine which elements can be deferred and which libraries |
| 7 // much be included in the initial download (loaded eagerly). | 7 // much be included in the initial download (loaded eagerly). |
| 8 | 8 |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 import "package:async_helper/async_helper.dart"; | 10 import "package:async_helper/async_helper.dart"; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 OutputUnit ou_lib4_1 = outputUnitForElement(bar1); | 69 OutputUnit ou_lib4_1 = outputUnitForElement(bar1); |
| 70 OutputUnit ou_lib4_2 = outputUnitForElement(bar2); | 70 OutputUnit ou_lib4_2 = outputUnitForElement(bar2); |
| 71 | 71 |
| 72 Expect.equals(mainOutputUnit, outputUnitForElement(main)); | 72 Expect.equals(mainOutputUnit, outputUnitForElement(main)); |
| 73 Expect.notEquals(mainOutputUnit, outputUnitForElement(foo1)); | 73 Expect.notEquals(mainOutputUnit, outputUnitForElement(foo1)); |
| 74 Expect.notEquals(ou_lib1, ou_lib1_lib2); | 74 Expect.notEquals(ou_lib1, ou_lib1_lib2); |
| 75 Expect.notEquals(ou_lib2, ou_lib1_lib2); | 75 Expect.notEquals(ou_lib2, ou_lib1_lib2); |
| 76 Expect.notEquals(ou_lib1, ou_lib2); | 76 Expect.notEquals(ou_lib1, ou_lib2); |
| 77 Expect.notEquals(ou_lib4_1, ou_lib4_2); | 77 Expect.notEquals(ou_lib4_1, ou_lib4_2); |
| 78 Expect.notEquals(ou_lib1, ou_lib4_2); | 78 Expect.notEquals(ou_lib1, ou_lib4_2); |
| 79 // InputElement is native, so it should not appear on a classList | 79 // InputElement is native, so it should be in the mainOutputUnit. |
| 80 Expect.isFalse(outputClassLists[outputUnitForElement(inputElement)] | 80 Expect.equals(mainOutputUnit, outputUnitForElement(inputElement)); |
| 81 .contains(inputElement)); | |
| 82 | 81 |
| 83 var hunksToLoad = compiler.deferredLoadTask.hunksToLoad; | 82 var hunksToLoad = compiler.deferredLoadTask.hunksToLoad; |
| 84 | 83 |
| 85 var hunksLib1 = hunksToLoad["lib1"]; | 84 var hunksLib1 = hunksToLoad["lib1"]; |
| 86 var hunksLib2 = hunksToLoad["lib2"]; | 85 var hunksLib2 = hunksToLoad["lib2"]; |
| 87 var hunksLib4_1 = hunksToLoad["lib4_1"]; | 86 var hunksLib4_1 = hunksToLoad["lib4_1"]; |
| 88 var hunksLib4_2 = hunksToLoad["lib4_2"]; | 87 var hunksLib4_2 = hunksToLoad["lib4_2"]; |
| 89 Expect.listEquals([ou_lib1_lib2, ou_lib1], hunksLib1); | 88 Expect.listEquals([ou_lib1_lib2, ou_lib1], hunksLib1); |
| 90 Expect.listEquals([ou_lib1_lib2, ou_lib2], hunksLib2); | 89 Expect.listEquals([ou_lib1_lib2, ou_lib2], hunksLib2); |
| 91 Expect.listEquals([ou_lib4_1], hunksLib4_1); | 90 Expect.listEquals([ou_lib4_1], hunksLib4_1); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 163 |
| 165 bar1() { | 164 bar1() { |
| 166 return "hello"; | 165 return "hello"; |
| 167 } | 166 } |
| 168 | 167 |
| 169 bar2() { | 168 bar2() { |
| 170 return 2; | 169 return 2; |
| 171 } | 170 } |
| 172 """, | 171 """, |
| 173 }; | 172 }; |
| OLD | NEW |