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 "dart:async"; | 5 import "dart:async"; |
6 import 'package:expect/expect.dart'; | 6 import 'package:expect/expect.dart'; |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 | 8 |
9 // This library contains a member loadLibrary. | 9 // This library contains a member loadLibrary. |
10 // Check that we shadow this member. | 10 // Check that we shadow this member. |
11 import "deferred_shadow_load_library_lib.dart" deferred as lib; | 11 import "deferred_shadow_load_library_lib.dart" deferred as lib; |
12 | 12 |
13 void main() { | 13 void main() { |
14 var x = lib.loadLibrary(); | 14 var x = lib.loadLibrary(); |
15 Expect.isTrue(x is Future); | 15 Expect.isTrue(x is Future); |
16 asyncStart(); | 16 asyncStart(); |
17 x.then((_) { | 17 x.then((_) { |
18 Expect.isTrue(lib.trueVar); | 18 Expect.isTrue(lib.trueVar); |
19 // Check that shadowing still is in place after loading the library. | 19 // Check that shadowing still is in place after loading the library. |
20 Expect.isTrue(lib.loadLibrary() is Future); | 20 Expect.isTrue(lib.loadLibrary() is Future); |
21 asyncEnd(); | 21 asyncEnd(); |
22 }); | 22 }); |
23 } | 23 } |
OLD | NEW |