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 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
6 | 6 |
7 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
9 | 9 |
10 const MAIN = """ | 10 const MAIN = """ |
11 import 'dart:async'; | 11 import 'dart:async'; |
12 | 12 |
13 @lazyA import 'a.dart' as a; | 13 import 'a.dart' deferred as a; |
14 @lazyB import 'b.dart' as b; | 14 import 'b.dart' deferred as b; |
15 | |
16 const lazyA = const DeferredLibrary('a', uri: 'a.js'); | |
17 const lazyB = const DeferredLibrary('b', uri: 'b.js'); | |
18 | 15 |
19 void main() { | 16 void main() { |
20 Future.wait([lazyA.load(), lazyB.load()]).then((_) { | 17 Future.wait([lazyA.loadLibrary(), lazyB.loadLibrary()]).then((_) { |
21 a.fn(); | 18 a.fn(); |
22 b.fn(); | 19 b.fn(); |
23 }); | 20 }); |
24 } | 21 } |
25 """; | 22 """; |
26 | 23 |
27 const A = """ | 24 const A = """ |
28 library a; | 25 library a; |
29 | 26 |
30 fn() => print("a"); | 27 fn() => print("a"); |
(...skipping 22 matching lines...) Expand all Loading... |
53 ]).create(); | 50 ]).create(); |
54 | 51 |
55 schedulePub(args: ["build"], | 52 schedulePub(args: ["build"], |
56 output: new RegExp(r'Built 4 files to "build".')); | 53 output: new RegExp(r'Built 4 files to "build".')); |
57 | 54 |
58 d.dir(appPath, [ | 55 d.dir(appPath, [ |
59 d.dir('build', [ | 56 d.dir('build', [ |
60 d.dir('web', [ | 57 d.dir('web', [ |
61 d.matcherFile('main.dart.js', isNot(isEmpty)), | 58 d.matcherFile('main.dart.js', isNot(isEmpty)), |
62 d.matcherFile('main.dart.precompiled.js', isNot(isEmpty)), | 59 d.matcherFile('main.dart.precompiled.js', isNot(isEmpty)), |
63 d.matcherFile('main.dart.js_a.part.js', isNot(isEmpty)), | 60 d.matcherFile('main.dart.js_1.part.js', isNot(isEmpty)), |
64 d.matcherFile('main.dart.js_b.part.js', isNot(isEmpty)), | 61 d.matcherFile('main.dart.js_2.part.js', isNot(isEmpty)), |
65 ]) | 62 ]) |
66 ]) | 63 ]) |
67 ]).validate(); | 64 ]).validate(); |
68 }); | 65 }); |
69 } | 66 } |
OLD | NEW |