| 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 // Dart2js can take a long time to compile dart code, so we increase the timeout |
| 6 // to cope with that. |
| 7 @Timeout.factor(3) |
| 8 |
| 5 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 | 10 |
| 7 import '../descriptor.dart' as d; | 11 import '../descriptor.dart' as d; |
| 8 import '../test_pub.dart'; | 12 import '../test_pub.dart'; |
| 9 | 13 |
| 10 const MAIN = """ | 14 const MAIN = """ |
| 11 import 'dart:async'; | 15 import 'dart:async'; |
| 12 | 16 |
| 13 import 'a.dart' deferred as a; | 17 import 'a.dart' deferred as a; |
| 14 import 'b.dart' deferred as b; | 18 import 'b.dart' deferred as b; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 27 fn() => print("a"); | 31 fn() => print("a"); |
| 28 """; | 32 """; |
| 29 | 33 |
| 30 const B = """ | 34 const B = """ |
| 31 library b; | 35 library b; |
| 32 | 36 |
| 33 fn() => print("b"); | 37 fn() => print("b"); |
| 34 """; | 38 """; |
| 35 | 39 |
| 36 main() { | 40 main() { |
| 37 initConfig(); | |
| 38 integration("compiles deferred libraries to separate outputs", () { | 41 integration("compiles deferred libraries to separate outputs", () { |
| 39 // Dart2js can take a long time to compile dart code, so we increase the | |
| 40 // timeout to cope with that. | |
| 41 currentSchedule.timeout *= 3; | |
| 42 | |
| 43 d.dir(appPath, [ | 42 d.dir(appPath, [ |
| 44 d.appPubspec(), | 43 d.appPubspec(), |
| 45 d.dir('web', [ | 44 d.dir('web', [ |
| 46 d.file('main.dart', MAIN), | 45 d.file('main.dart', MAIN), |
| 47 d.file('a.dart', A), | 46 d.file('a.dart', A), |
| 48 d.file('b.dart', B) | 47 d.file('b.dart', B) |
| 49 ]) | 48 ]) |
| 50 ]).create(); | 49 ]).create(); |
| 51 | 50 |
| 52 schedulePub(args: ["build"], | 51 schedulePub(args: ["build"], |
| 53 output: new RegExp(r'Built 3 files to "build".')); | 52 output: new RegExp(r'Built 3 files to "build".')); |
| 54 | 53 |
| 55 d.dir(appPath, [ | 54 d.dir(appPath, [ |
| 56 d.dir('build', [ | 55 d.dir('build', [ |
| 57 d.dir('web', [ | 56 d.dir('web', [ |
| 58 d.matcherFile('main.dart.js', isNot(isEmpty)), | 57 d.matcherFile('main.dart.js', isNot(isEmpty)), |
| 59 d.matcherFile('main.dart.js_1.part.js', isNot(isEmpty)), | 58 d.matcherFile('main.dart.js_1.part.js', isNot(isEmpty)), |
| 60 d.matcherFile('main.dart.js_2.part.js', isNot(isEmpty)), | 59 d.matcherFile('main.dart.js_2.part.js', isNot(isEmpty)), |
| 61 ]) | 60 ]) |
| 62 ]) | 61 ]) |
| 63 ]).validate(); | 62 ]).validate(); |
| 64 }); | 63 }); |
| 65 } | 64 } |
| OLD | NEW |