Chromium Code Reviews| 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 472d8eafe8cf36d006995faef50677ff492d39f3..a697be4522bfd87b686c51fe94a1133c7ac2835b 100644 |
| --- a/samples/third_party/todomvc/test/listorder_test.dart |
| +++ b/samples/third_party/todomvc/test/listorder_test.dart |
| @@ -4,9 +4,9 @@ |
| library todomvc.test.listorder_test; |
| +import 'dart:async'; |
| import 'dart:html'; |
| import 'package:polymer/polymer.dart'; |
| -import 'package:polymer/platform.dart' show endOfMicrotask; |
| import 'package:unittest/unittest.dart'; |
| import 'package:unittest/html_config.dart'; |
| import '../web/model.dart'; |
| @@ -32,7 +32,8 @@ main() { |
| new Todo('two (checked)')..done = true, |
| new Todo('three (unchecked)') |
| ]); |
| - endOfMicrotask(expectAsync0(() { |
| + Observable.dirtyCheck(); |
| + return window.animationFrame.then((_) { |
|
Jennifer Messerly
2013/10/25 21:02:21
one idea here is to use mutation observers to watc
|
| expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); |
| // TODO(jmesserly): HTML Imports breaks relative hash links when the |
| @@ -41,27 +42,27 @@ main() { |
| for (var a in root.queryAll('#filters > li > a')) { |
| a.href = '#${Uri.parse(a.href).fragment}'; |
| } |
| - })); |
| + }); |
| }); |
| test('navigate to #/active', () { |
| windowLocation.hash = '#/active'; |
| - endOfMicrotask(expectAsync0(() { |
| + return window.animationFrame.then((_) { |
| expect(root.queryAll('#todo-list li[is=todo-row]').length, 2); |
| - })); |
| + }); |
| }); |
| test('navigate to #/completed', () { |
| windowLocation.hash = '#/completed'; |
| - endOfMicrotask(expectAsync0(() { |
| + return window.animationFrame.then((_) { |
| expect(root.queryAll('#todo-list li[is=todo-row]').length, 1); |
| - })); |
| + }); |
| }); |
| test('navigate back to #/', () { |
| windowLocation.hash = '#/'; |
| - endOfMicrotask(expectAsync0(() { |
| + return window.animationFrame.then((_) { |
| expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); |
| - })); |
| + }); |
| }); |
| } |