OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.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 main() { | 10 main() { |
11 // This test is a bit shaky. Since dart2js is free to inline things, it's | 11 // This test is a bit shaky. Since dart2js is free to inline things, it's |
12 // not precise as to which source libraries will actually be referenced in | 12 // not precise as to which source libraries will actually be referenced in |
13 // the source map. But this tries to use a type in the core library | 13 // the source map. But this tries to use a type in the core library |
14 // (Duration) and validate that its source ends up in the source map. | 14 // (Duration) and validate that its source ends up in the source map. |
15 integration("Dart core libraries are available to source maps", () { | 15 integration("Dart core libraries are available to source maps", () { |
16 d.dir(appPath, [ | 16 d.dir(appPath, [ |
17 d.appPubspec(), | 17 d.appPubspec(), |
18 d.dir("web", [ | 18 d.dir("web", [ |
19 d.file("main.dart", "main() => new Duration().toString();"), | 19 d.file("main.dart", "main() => new Duration().toString();"), |
20 d.dir("sub", [ | 20 d.dir("sub", [ |
21 d.file("main.dart", "main() => new Duration().toString();") | 21 d.file("main.dart", "main() => new Duration().toString();") |
22 ]) | 22 ]) |
23 ]) | 23 ]) |
24 ]).create(); | 24 ]).create(); |
25 | 25 |
| 26 pubGet(); |
26 schedulePub(args: ["build", "--mode", "debug"], | 27 schedulePub(args: ["build", "--mode", "debug"], |
27 output: new RegExp(r'Built \d+ files to "build".'), | 28 output: new RegExp(r'Built \d+ files to "build".'), |
28 exitCode: 0); | 29 exitCode: 0); |
29 | 30 |
30 d.dir(appPath, [ | 31 d.dir(appPath, [ |
31 d.dir("build", [ | 32 d.dir("build", [ |
32 d.dir("web", [ | 33 d.dir("web", [ |
33 d.matcherFile("main.dart.js.map", | 34 d.matcherFile("main.dart.js.map", |
34 contains(r"packages/$sdk/lib/core/duration.dart")), | 35 contains(r"packages/$sdk/lib/core/duration.dart")), |
35 d.dir("sub", [ | 36 d.dir("sub", [ |
36 d.matcherFile("main.dart.js.map", | 37 d.matcherFile("main.dart.js.map", |
37 contains(r"../packages/$sdk/lib/core/duration.dart")) | 38 contains(r"../packages/$sdk/lib/core/duration.dart")) |
38 ]), | 39 ]), |
39 d.dir("packages", [ | 40 d.dir("packages", [ |
40 d.dir(r"$sdk", [ | 41 d.dir(r"$sdk", [ |
41 d.dir("lib", [ | 42 d.dir("lib", [ |
42 d.dir(r"core", [ | 43 d.dir(r"core", [ |
43 d.matcherFile("duration.dart", | 44 d.matcherFile("duration.dart", |
44 contains("class Duration")) | 45 contains("class Duration")) |
45 ]) | 46 ]) |
46 ]) | 47 ]) |
47 ]) | 48 ]) |
48 ]) | 49 ]) |
49 ]) | 50 ]) |
50 ]) | 51 ]) |
51 ]).validate(); | 52 ]).validate(); |
52 }); | 53 }); |
53 } | 54 } |
OLD | NEW |