| 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 <script type="application/javascript" src="testing.js"></script> | 11 <script type="application/javascript" src="testing.js"></script> |
| 12 </head> | 12 </head> |
| 13 <body> | 13 <body> |
| 14 <!-- Tests the iterate attribute on a node. --> | 14 <!-- Tests the iterate attribute on a node. --> |
| 15 <div id='test' template iterate="x in list"> | 15 <div id='test' template iterate="x in list"> |
| 16 <span>{{x}}</span> | 16 <span>{{x}}</span> |
| 17 </div> | 17 </div> |
| 18 <script type="application/dart"> | 18 <script type="application/dart"> |
| 19 import 'dart:html'; | 19 import 'dart:html'; |
| 20 import 'package:unittest/unittest.dart'; | 20 import 'package:unittest/unittest.dart'; |
| 21 import 'package:web_components/watcher.dart'; | 21 import 'package:web_ui/watcher.dart'; |
| 22 | 22 |
| 23 var list = <String>['a', 'b', 'c', 'e']; | 23 var list = <String>['a', 'b', 'c', 'e']; |
| 24 main() { | 24 main() { |
| 25 window.setTimeout(() { | 25 window.setTimeout(() { |
| 26 expect(document.query("#test").innerHtml, equalsIgnoringWhitespace( | 26 expect(document.query("#test").innerHtml, equalsIgnoringWhitespace( |
| 27 '<span>a</span> <span>b</span> <span>c</span> <span>e</span>')); | 27 '<span>a</span> <span>b</span> <span>c</span> <span>e</span>')); |
| 28 list[3] = 'd'; | 28 list[3] = 'd'; |
| 29 dispatch(); | 29 dispatch(); |
| 30 window.setTimeout(() { | 30 window.setTimeout(() { |
| 31 expect(document.query("#test").innerHtml, equalsIgnoringWhitespace( | 31 expect(document.query("#test").innerHtml, equalsIgnoringWhitespace( |
| 32 '<span>a</span> <span>b</span> <span>c</span> <span>d</span>')); | 32 '<span>a</span> <span>b</span> <span>c</span> <span>d</span>')); |
| 33 window.setTimeout(() => window.postMessage('done', '*'), 0); | 33 window.setTimeout(() => window.postMessage('done', '*'), 0); |
| 34 }, 0); | 34 }, 0); |
| 35 }, 0); | 35 }, 0); |
| 36 } | 36 } |
| 37 </script> | 37 </script> |
| 38 </body> | 38 </body> |
| 39 </html> | 39 </html> |
| OLD | NEW |