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 correct interaction of iteration and conditionals. --> | 14 <!-- Tests the correct interaction of iteration and conditionals. --> |
15 <table> | 15 <table> |
16 <tbody id='test' template iterate="row in table"> | 16 <tbody id='test' template iterate="row in table"> |
17 <tr template iterate="cell in row"> | 17 <tr template iterate="cell in row"> |
18 <td template if="cell != 0">{{cell}}</td> | 18 <td template if="cell != 0">{{cell}}</td> |
19 </tr> | 19 </tr> |
20 </tbody></table> | 20 </tbody></table> |
21 <script type="application/dart"> | 21 <script type="application/dart"> |
22 import 'dart:html'; | 22 import 'dart:html'; |
23 import 'package:unittest/unittest.dart'; | 23 import 'package:unittest/unittest.dart'; |
24 import 'package:web_components/watcher.dart'; | 24 import 'package:web_ui/watcher.dart'; |
25 | 25 |
26 List<List> table = [[1, 2, 3], [4, 0, 5], [0, 2, 4]]; | 26 List<List> table = [[1, 2, 3], [4, 0, 5], [0, 2, 4]]; |
27 main() { | 27 main() { |
28 window.setTimeout(() { | 28 window.setTimeout(() { |
29 table[1][1] = 9; | 29 table[1][1] = 9; |
30 dispatch(); | 30 dispatch(); |
31 window.setTimeout(() { | 31 window.setTimeout(() { |
32 var test = document.query('#test'); | 32 var test = document.query('#test'); |
33 expect(test.elements.length, table.length); | 33 expect(test.elements.length, table.length); |
34 for (int row = 0; row < table.length; row++) { | 34 for (int row = 0; row < table.length; row++) { |
(...skipping 12 matching lines...) Expand all Loading... |
47 expect(td.innerHtml, value.toString()); | 47 expect(td.innerHtml, value.toString()); |
48 } | 48 } |
49 } | 49 } |
50 window.setTimeout(() => window.postMessage('done', '*'), 0); | 50 window.setTimeout(() => window.postMessage('done', '*'), 0); |
51 }, 0); | 51 }, 0); |
52 }, 0); | 52 }, 0); |
53 } | 53 } |
54 </script> | 54 </script> |
55 </body> | 55 </body> |
56 </html> | 56 </html> |
OLD | NEW |