| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 for details. All rights reserved. Use of this source code is governed by a | 4 for details. All rights reserved. Use of this source code is governed by a |
| 5 BSD-style license that can be found in the LICENSE file. | 5 BSD-style license that can be found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <html lang="en"> | 7 <html lang="en"> |
| 8 <head> | 8 <head> |
| 9 <meta charset="utf-8"> | 9 <meta charset="utf-8"> |
| 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 11 <title>watch_global_var_test</title> | 11 <title>watch_global_var_test</title> |
| 12 <!-- use ../input/ so that the url also works from the output directory --> | 12 <script type='application/javascript' src="testing.js"></script> |
| 13 <script type='application/javascript' src="../input/testing.js"></script> | |
| 14 </head> | 13 </head> |
| 15 <body> | 14 <body> |
| 16 <template instantiate="if cond"> | 15 <template instantiate="if cond"> |
| 17 <span>you should not see: yes</span> | 16 <span>you should not see: yes</span> |
| 18 </template> | 17 </template> |
| 19 <template instantiate="if notCond"> | 18 <template instantiate="if notCond"> |
| 20 <span>you should see: no</span> | 19 <span>you should see: no</span> |
| 21 </template> | 20 </template> |
| 22 <script type="application/dart"> | 21 <script type="application/dart"> |
| 23 import 'dart:html'; | 22 import 'dart:html'; |
| 24 import 'package:web_components/watcher.dart'; | 23 import 'package:web_components/watcher.dart'; |
| 25 import '../input/common.dart'; | 24 import 'common.dart'; |
| 26 main() { | 25 main() { |
| 27 window.setTimeout(() { | 26 window.setTimeout(() { |
| 28 cond = true; | 27 cond = true; |
| 29 dispatch(); | 28 dispatch(); |
| 30 window.setTimeout(() { | 29 window.setTimeout(() { |
| 31 cond = false; | 30 cond = false; |
| 32 dispatch(); | 31 dispatch(); |
| 33 // in the end, we should see 'no' again | 32 // in the end, we should see 'no' again |
| 34 window.setTimeout(() => window.postMessage('done', '*'), 0); | 33 window.setTimeout(() => window.postMessage('done', '*'), 0); |
| 35 }, 0); | 34 }, 0); |
| 36 }, 0); | 35 }, 0); |
| 37 } | 36 } |
| 38 </script> | 37 </script> |
| 39 </body> | 38 </body> |
| 40 </html> | 39 </html> |
| OLD | NEW |