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"> |
(...skipping 12 matching lines...) Expand all Loading... |
23 import 'package:unittest/unittest.dart'; | 23 import 'package:unittest/unittest.dart'; |
24 import 'package:web_ui/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.children.length, table.length); |
34 for (int row = 0; row < table.length; row++) { | 34 for (int row = 0; row < table.length; row++) { |
35 var tr = test.elements[row]; | 35 var tr = test.children[row]; |
36 expect(tr.tagName, 'TR'); | 36 expect(tr.tagName, 'TR'); |
37 int column = -1; | 37 int column = -1; |
38 for (var td in tr.elements) { | 38 for (var td in tr.children) { |
39 expect(td.tagName, 'TD'); | 39 expect(td.tagName, 'TD'); |
40 if (td.style.display == 'none') { | 40 if (td.style.display == 'none') { |
41 column++; | 41 column++; |
42 continue; | 42 continue; |
43 } | 43 } |
44 | 44 |
45 var value = table[row][column]; | 45 var value = table[row][column]; |
46 expect(value, greaterThan(0)); | 46 expect(value, greaterThan(0)); |
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 |