| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 for details. All rights reserved. Use of this source code is governed by a | 4 for details. All rights reserved. Use of this source code is governed by a |
| 5 BSD-style license that can be found in the LICENSE file. | 5 BSD-style license that can be found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <html lang="en"> | 7 <html lang="en"> |
| 8 <head> | 8 <head> |
| 9 <!-- | 9 <!-- |
| 10 This test runs the TodoMVC app, adds a few elements, marks some as done, and | 10 This test runs the TodoMVC app, adds a few elements, marks some as done, and |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 mdv.initialize(); | 36 mdv.initialize(); |
| 37 | 37 |
| 38 Timer.run(() { | 38 Timer.run(() { |
| 39 appModel.todos.add(new Todo('one (unchecked)')); | 39 appModel.todos.add(new Todo('one (unchecked)')); |
| 40 appModel.todos.add(new Todo('two (checked)')..done = true); | 40 appModel.todos.add(new Todo('two (checked)')..done = true); |
| 41 appModel.todos.add(new Todo('three (unchecked)')); | 41 appModel.todos.add(new Todo('three (unchecked)')); |
| 42 | 42 |
| 43 var root = query('span[is=todo-app]').xtag.shadowRoot; | 43 var root = query('span[is=todo-app]').xtag.shadowRoot; |
| 44 | 44 |
| 45 windowLocation.hash = '#/'; | 45 windowLocation.hash = '#/'; |
| 46 deliverChangeRecords(); | |
| 47 Timer.run(() { | 46 Timer.run(() { |
| 48 expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); | 47 expect(root.queryAll('#todo-list li[is=todo-row]').length, 3); |
| 49 | 48 |
| 50 windowLocation.hash = '#/active'; | 49 windowLocation.hash = '#/active'; |
| 51 deliverChangeRecords(); | 50 Timer.run(() { |
| 52 expect(root.queryAll('#todo-list li[is=todo-row]').length, 2); | 51 expect(root.queryAll('#todo-list li[is=todo-row]').length, 2); |
| 53 | 52 |
| 54 windowLocation.hash = '#/completed'; | 53 windowLocation.hash = '#/completed'; |
| 55 deliverChangeRecords(); | 54 Timer.run(() { |
| 56 expect(root.queryAll('#todo-list li[is=todo-row]').length, 1); | 55 expect(root.queryAll('#todo-list li[is=todo-row]').length, 1); |
| 57 | 56 |
| 58 windowLocation.hash = '#/'; | 57 windowLocation.hash = '#/'; |
| 59 deliverChangeRecords(); | 58 // TODO(sigmund): investigate why is not enough to do Timer.run |
| 60 Timer.run(() { | 59 new Timer(new Duration(milliseconds: 200), () { |
| 61 window.postMessage('done', '*'); | 60 window.postMessage('done', '*'); |
| 61 }); |
| 62 }); |
| 62 }); | 63 }); |
| 63 }); | 64 }); |
| 64 }); | 65 }); |
| 65 } | 66 } |
| 66 </script> | 67 </script> |
| 67 </body> | 68 </body> |
| 68 </html> | 69 </html> |
| OLD | NEW |