Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: test/data/input/table_test.html

Issue 12225039: Support for observable models, fixes #259 (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/data/input/style_binding_test.html ('k') | test/data/input/template_multiple_children_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/data/input/table_test.html
diff --git a/test/data/input/table_test.html b/test/data/input/table_test.html
index a44a50e4e3445d5063d27875a40d9a7d9b443a80..f394f1dedb1cc7cb1fa2edb2c2f2bc5f4c2f0580 100644
--- a/test/data/input/table_test.html
+++ b/test/data/input/table_test.html
@@ -22,11 +22,17 @@ BSD-style license that can be found in the LICENSE file.
<script type="application/dart">
import 'dart:html';
import 'package:unittest/unittest.dart';
- import 'package:web_ui/watcher.dart';
+ import 'package:web_ui/observe.dart';
+
+ @observable
+ List<List> table = toObservable([
+ toObservable([1, 2, 3]),
+ toObservable(['a', 'b', 'c']),
+ toObservable(['A', 'B', 'C'])
+ ]);
- List<List> table = [[1, 2, 3], ['a', 'b', 'c'], ['A', 'B', 'C']];
main() {
- window.setTimeout(() {
+ window.setImmediate(() {
expect(document.query("#test").innerHtml, equalsIgnoringWhitespace(
'<tr> <td>1</td> <td>2</td> <td>3</td> </tr> '
'<tr> <td>a</td> <td>b</td> <td>c</td> </tr> '
@@ -34,16 +40,14 @@ BSD-style license that can be found in the LICENSE file.
table[0][2] = 'X';
table[1][1] = 'Y';
table.add(['_', '__', '___']);
- dispatch();
- window.setTimeout(() {
- expect(document.query("#test").innerHtml, equalsIgnoringWhitespace(
- '<tr> <td>1</td> <td>2</td> <td>X</td> </tr> '
- '<tr> <td>a</td> <td>Y</td> <td>c</td> </tr> '
- '<tr> <td>A</td> <td>B</td> <td>C</td> </tr> '
- '<tr> <td>_</td> <td>__</td> <td>___</td> </tr>'));
- window.setTimeout(() => window.postMessage('done', '*'), 0);
- }, 0);
- }, 0);
+ deliverChangesSync();
+ expect(document.query("#test").innerHtml, equalsIgnoringWhitespace(
+ '<tr> <td>1</td> <td>2</td> <td>X</td> </tr> '
+ '<tr> <td>a</td> <td>Y</td> <td>c</td> </tr> '
+ '<tr> <td>A</td> <td>B</td> <td>C</td> </tr> '
+ '<tr> <td>_</td> <td>__</td> <td>___</td> </tr>'));
+ window.postMessage('done', '*');
+ });
}
</script>
</body>
« no previous file with comments | « test/data/input/style_binding_test.html ('k') | test/data/input/template_multiple_children_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698