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

Unified Diff: samples/third_party/todomvc/test/listorder_test.dart

Issue 29823005: fixes to polymer, gets tests back to a stable state (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
Index: samples/third_party/todomvc/test/listorder_test.dart
diff --git a/samples/third_party/todomvc/test/listorder_test.dart b/samples/third_party/todomvc/test/listorder_test.dart
index 0d70dfadf4c516ad6189dd816cca576ce17434cf..1e8f8db251c837fcb017be086090e5bbc787ad1a 100644
--- a/samples/third_party/todomvc/test/listorder_test.dart
+++ b/samples/third_party/todomvc/test/listorder_test.dart
@@ -19,9 +19,12 @@ import '../web/model.dart';
_main() {
useHtmlConfiguration();
- final root = query('todo-app').shadowRoot;
- setUp(() => Polymer.onReady);
+ ShadowRoot root;
+
+ setUp(() => Polymer.onReady.then((_) {
+ root = query('todo-app').shadowRoot;
+ }));
test('programmatically add items to model', () {
appModel.todos.addAll([
@@ -29,32 +32,36 @@ _main() {
new Todo('two (checked)')..done = true,
new Todo('three (unchecked)')
]);
- performMicrotaskCheckpoint();
- expect(root.queryAll('#todo-list li[is=todo-row]').length, 3);
-
- // TODO(jmesserly): HTML Imports breaks relative hash links when the
- // component is at a different path from the main HTML document. For now we
- // fix it programmatically.
- for (var a in root.queryAll('#filters > li > a')) {
- a.href = '#${Uri.parse(a.href).fragment}';
- }
+ endOfMicrotask(expectAsync0(() {
Siggi Cherem (dart-lang) 2013/10/21 21:07:42 ... it would be nice to have a future for endOfMic
Jennifer Messerly 2013/10/21 21:42:56 agree. this is covered by another bug.
+ expect(root.queryAll('#todo-list li[is=todo-row]').length, 3);
+
+ // TODO(jmesserly): HTML Imports breaks relative hash links when the
+ // component is at a different path from the main HTML document. For now we
Siggi Cherem (dart-lang) 2013/10/21 21:07:42 80
Jennifer Messerly 2013/10/21 21:42:56 Done.
+ // fix it programmatically.
+ for (var a in root.queryAll('#filters > li > a')) {
+ a.href = '#${Uri.parse(a.href).fragment}';
+ }
+ }));
});
test('navigate to #/active', () {
windowLocation.hash = '#/active';
- performMicrotaskCheckpoint();
- expect(root.queryAll('#todo-list li[is=todo-row]').length, 2);
+ endOfMicrotask(expectAsync0(() {
+ expect(root.queryAll('#todo-list li[is=todo-row]').length, 2);
+ }));
});
test('navigate to #/completed', () {
windowLocation.hash = '#/completed';
- performMicrotaskCheckpoint();
- expect(root.queryAll('#todo-list li[is=todo-row]').length, 1);
+ endOfMicrotask(expectAsync0(() {
+ expect(root.queryAll('#todo-list li[is=todo-row]').length, 1);
+ }));
});
test('navigate back to #/', () {
windowLocation.hash = '#/';
- performMicrotaskCheckpoint();
- expect(root.queryAll('#todo-list li[is=todo-row]').length, 3);
+ endOfMicrotask(expectAsync0(() {
+ expect(root.queryAll('#todo-list li[is=todo-row]').length, 3);
+ }));
});
}

Powered by Google App Engine
This is Rietveld 408576698