OLD | NEW |
1 import 'dart:isolate'; | 1 import 'dart:isolate'; |
2 import 'dart:async'; | 2 import 'dart:async'; |
3 import 'dart:html'; | 3 import 'dart:html'; |
4 import 'package:unittest/unittest.dart'; | 4 import 'package:unittest/unittest.dart'; |
5 | 5 |
6 @a import 'deferred_in_isolate_lib.dart' as lib1; | 6 @a import 'deferred_in_isolate_lib.dart' as lib1; |
7 @b import 'deferred_api_library.dart' as lib2; | 7 @b import 'deferred_library.dart' as lib2; |
8 | 8 |
9 const a = const DeferredLibrary("lib1"); | 9 const a = const DeferredLibrary("lib1"); |
10 const b = const DeferredLibrary("NonExistingFile", uri: "wrong/wrong.js"); | 10 const b = const DeferredLibrary("NonExistingFile", uri: "wrong/wrong.js"); |
11 | 11 |
12 main() { | 12 main() { |
13 test("Deferred loading failing to load", () { | 13 test("Deferred loading failing to load", () { |
14 a.load().then(expectAsync((_) { | 14 a.load().then(expectAsync((_) { |
15 expect(lib1.f(), equals("hi")); | 15 expect(lib1.f(), equals("hi")); |
16 })); | 16 })); |
17 b.load().then((_) { | 17 b.load().then((_) { |
18 expect(false, true); | 18 expect(false, true); |
19 lib2.foo(""); | 19 lib2.foo(""); |
20 }).catchError(expectAsync((_) { | 20 }).catchError(expectAsync((_) { |
21 expect(true, true); | 21 expect(true, true); |
22 }), test: (e) => e is DeferredLoadException); | 22 }), test: (e) => e is DeferredLoadException); |
23 }); | 23 }); |
24 } | 24 } |
OLD | NEW |