OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 import "deferred_multi_app_lib.dart" deferred as lib; |
| 6 import "dart:async"; |
| 7 import "dart:html"; |
| 8 import "package:expect/expect.dart"; |
| 9 |
| 10 main() { |
| 11 Element state = querySelector("#state"); |
| 12 if (state.text == "1") { |
| 13 lib.loadLibrary().then((_) { |
| 14 var a = lib.one(); |
| 15 Expect.equals("one", a); |
| 16 window.postMessage(a, '*'); |
| 17 }); |
| 18 state.text = "2"; |
| 19 } else { |
| 20 new Timer(new Duration(milliseconds: 100), () { |
| 21 lib.loadLibrary().then((_) { |
| 22 var a = lib.two(); |
| 23 Expect.equals("two", a); |
| 24 window.postMessage(a, '*'); |
| 25 }); |
| 26 }); |
| 27 } |
| 28 } |
OLD | NEW |