Chromium Code Reviews| Index: tests/language/deferred_global_test.dart |
| diff --git a/tests/language/deferred_global_test.dart b/tests/language/deferred_global_test.dart |
| index 709921ea5b8e855fb3a0624975beecfdf72bb71a..f7106e6034091a9444189a2883553b3d2b7dd216 100644 |
| --- a/tests/language/deferred_global_test.dart |
| +++ b/tests/language/deferred_global_test.dart |
| @@ -7,9 +7,16 @@ import 'package:async_helper/async_helper.dart'; |
| import "deferred_global_lib.dart" deferred as lib; |
| +var nonDeferredGlobal = const {}; |
| + |
| void main() { |
| + nonDeferredGlobal = null; |
| asyncStart(); |
| lib.loadLibrary().then((_) { |
| + // Ensure non-deferred globals are not reset when loading a deferred |
| + // library. |
| + Expect.equals(null, nonDeferredGlobal); |
| + |
| Expect.equals("finalConstGlobal", lib.finalConstGlobal); |
| Expect.equals(0, lib.sideEffectCounter); |
| Expect.equals("finalNonConstGlobal", lib.finalNonConstGlobal); |
| @@ -40,6 +47,15 @@ void main() { |
| Expect.equals("lazyConstGlobal_mutated2", lib.readLazyConstGlobal()); |
| Expect.equals("lazyNonConstGlobal_mutated2", lib.readLazyNonConstGlobal()); |
| + Expect.mapEquals({}, lib.lazyConstGlobal2); |
| + lib.const1Global = 0; |
| + Expect.equals(0, lib.const1Global); |
| + // Try loading the deferred library again, should not reset the globals. |
| + lib.loadLibrary().then((_) { |
| + Expect.equals(0, lib.const1Global); |
| + }); |
| + |
| + |
| Expect.equals(2, lib.sideEffectCounter); |
| asyncEnd(); |
|
floitsch
2014/12/11 13:37:30
This asyncEnd is before the lib.loadLibrary() abov
|
| }); |