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

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
« no previous file with comments | « pkg/polymer/test/publish_attributes_test.dart ('k') | samples/third_party/todomvc/test/markdone_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..99f684462e4a28ea36d0b55e9b8811221597d23b 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(() {
+ 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
+ // 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);
+ }));
});
}
« no previous file with comments | « pkg/polymer/test/publish_attributes_test.dart ('k') | samples/third_party/todomvc/test/markdone_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698