| 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 '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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 import 'lib1.dart' as lib1; | 66 import 'lib1.dart' as lib1; |
| 67 | 67 |
| 68 void main() { | 68 void main() { |
| 69 lib1.foo1(); | 69 lib1.foo1(); |
| 70 } | 70 } |
| 71 """, | 71 """, |
| 72 "lib1.dart":""" | 72 "lib1.dart":""" |
| 73 library lib1; | 73 library lib1; |
| 74 | 74 |
| 75 import 'dart:async'; | 75 import 'lib2.dart' deferred as lib2; |
| 76 @def import 'lib2.dart' as lib2; | |
| 77 | 76 |
| 78 const def = const DeferredLibrary('lib2'); | 77 const def = const DeferredLibrary('lib2'); |
| 79 | 78 |
| 80 void foo1() { | 79 void foo1() { |
| 81 def.load().then((_) => lib2.foo2()); | 80 lib1.loadLibrary().then((_) => lib2.foo2()); |
| 82 } | 81 } |
| 83 """, | 82 """, |
| 84 "lib2.dart":""" | 83 "lib2.dart":""" |
| 85 library lib2; | 84 library lib2; |
| 86 | 85 |
| 87 void foo2() {} | 86 void foo2() {} |
| 88 """, | 87 """, |
| 89 }; | 88 }; |
| OLD | NEW |