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

Unified Diff: example/todomvc/test/todomvc_markdone_test.html

Issue 22962005: Merge pull request #581 from kevmoo/polymer (Closed) Base URL: https://github.com/dart-lang/web-ui.git@polymer
Patch Set: Created 7 years, 4 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 | « example/todomvc/test/todomvc_mainpage_test.html ('k') | example/todomvc/web/app.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: example/todomvc/test/todomvc_markdone_test.html
diff --git a/example/todomvc/test/todomvc_markdone_test.html b/example/todomvc/test/todomvc_markdone_test.html
index 304a279c5253eef444b110e674d270a1472d0568..3219312d63afb3aa01adcb50e2dc81dc558ca246 100644
--- a/example/todomvc/test/todomvc_markdone_test.html
+++ b/example/todomvc/test/todomvc_markdone_test.html
@@ -19,10 +19,7 @@ programatically, and clicks on a checkbox to mark others via the UI.
</head><body>
<todo-app></todo-app>
<script type="application/dart">
-import 'dart:async';
import 'dart:html';
-import 'package:mdv/mdv.dart' as mdv;
-import 'package:observe/observe.dart';
import 'package:unittest/unittest.dart';
import 'package:polymer/polymer.dart';
import '../web/model.dart';
@@ -60,36 +57,28 @@ Node findShadowHost(Node node, ShadowRoot root) {
}
main() {
- mdv.initialize();
+ appModel.todos.add(new Todo('one (unchecked)'));
+ appModel.todos.add(new Todo('two (unchecked)'));
+ appModel.todos.add(new Todo('three (checked)')..done = true);
+ appModel.todos.add(new Todo('four (checked)'));
- Timer.run(() {
- appModel.todos.add(new Todo('one (unchecked)'));
- appModel.todos.add(new Todo('two (unchecked)'));
- appModel.todos.add(new Todo('three (checked)')..done = true);
- appModel.todos.add(new Todo('four (checked)'));
+ performMicrotaskCheckpoint();
+ var body = query('body');
- // TODO(sigmund): investigate why is not enough to do Timer.run
- new Timer(new Duration(milliseconds: 200), () {
- // Note: use query because "document" is unwrapped in ShadowDOM polyfill.
- var body = query('body');
+ var label = findWithText(body, 'four (checked)');
+ expect(label is LabelElement, isTrue, reason: 'text is in a label');
- var label = findWithText(body, 'four (checked)');
- expect(label is LabelElement, isTrue, reason: 'text is in a label');
+ var host = findShadowHost(body, label.parentNode);
+ var node = host.parent.query('input');
+ expect(node is InputElement, isTrue, reason: 'node is a checkbox');
+ expect(node.type, 'checkbox', reason: 'node type is checkbox');
+ expect(node.checked, isFalse, reason: 'element is unchecked');
- var host = findShadowHost(body, label.parentNode);
- var node = host.parent.query('input');
- expect(node is InputElement, isTrue, reason: 'node is a checkbox');
- expect(node.type, 'checkbox', reason: 'node type is checkbox');
- expect(node.checked, isFalse, reason: 'element is unchecked');
+ node.dispatchEvent(new MouseEvent('click', detail: 1));
+ expect(node.checked, isTrue, reason: 'element is checked');
+ performMicrotaskCheckpoint();
- node.dispatchEvent(new MouseEvent('click', detail: 1));
- expect(node.checked, isTrue, reason: 'element is checked');
-
- Timer.run(() {
- window.postMessage('done', '*');
- });
- });
- });
+ window.postMessage('done', '*');
}
</script>
« no previous file with comments | « example/todomvc/test/todomvc_mainpage_test.html ('k') | example/todomvc/web/app.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698