| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Just check that the compile runs. | 50 // Just check that the compile runs. |
| 51 // This is a regression test. | 51 // This is a regression test. |
| 52 Expect.isTrue(true); | 52 Expect.isTrue(true); |
| 53 }); | 53 }); |
| 54 await runTest('memory:main3.dart', (compiler) { | 54 await runTest('memory:main3.dart', (compiler) { |
| 55 var main = compiler.mainFunction; | 55 var main = compiler.mainFunction; |
| 56 Expect.isNotNull(main, "Could not find 'main'"); | 56 Expect.isNotNull(main, "Could not find 'main'"); |
| 57 compiler.deferredLoadTask.onResolutionComplete(main); | 57 compiler.deferredLoadTask.onResolutionComplete(main); |
| 58 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; | 58 var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement; |
| 59 | 59 |
| 60 Expect.isFalse(compiler.backend.hasInsufficientMirrorsUsed); | 60 Expect.isFalse(compiler.backend.mirrorsData.hasInsufficientMirrorsUsed); |
| 61 var mainLib = lookupLibrary(compiler, "memory:main3.dart"); | 61 var mainLib = lookupLibrary(compiler, "memory:main3.dart"); |
| 62 var lib3 = lookupLibrary(compiler, "memory:lib3.dart"); | 62 var lib3 = lookupLibrary(compiler, "memory:lib3.dart"); |
| 63 var C = mainLib.find("C"); | 63 var C = mainLib.find("C"); |
| 64 var foo = lib3.find("foo"); | 64 var foo = lib3.find("foo"); |
| 65 | 65 |
| 66 Expect.notEquals(outputUnitForElement(main), outputUnitForElement(foo)); | 66 Expect.notEquals(outputUnitForElement(main), outputUnitForElement(foo)); |
| 67 Expect.equals(outputUnitForElement(main), outputUnitForElement(C)); | 67 Expect.equals(outputUnitForElement(main), outputUnitForElement(C)); |
| 68 }); | 68 }); |
| 69 await runTest('memory:main4.dart', (compiler) { | 69 await runTest('memory:main4.dart', (compiler) { |
| 70 var main = compiler.mainFunction; | 70 var main = compiler.mainFunction; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 library lib5; | 192 library lib5; |
| 193 | 193 |
| 194 foo() {} | 194 foo() {} |
| 195 """, | 195 """, |
| 196 "lib6.dart": """ | 196 "lib6.dart": """ |
| 197 library lib6; | 197 library lib6; |
| 198 | 198 |
| 199 foo() {} | 199 foo() {} |
| 200 """, | 200 """, |
| 201 }; | 201 }; |
| OLD | NEW |