| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2012, 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 and evaluates that it renders correctly if a | 10 This performance test runs the TodoMVC app and uses the application as follows: |
| 11 single item is present in the todo list. | 11 * on each iteration: |
| 12 * clear all todos |
| 13 * add 5 todos |
| 14 * mark 1 as done |
| 15 * clear the todo marked as done. |
| 12 --> | 16 --> |
| 13 <meta charset="utf-8"> | 17 <meta charset="utf-8"> |
| 14 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 18 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 15 <link rel="components" href="example/todomvc/router_options.html"> | 19 <link rel="components" href="example/todomvc/router_options.html"> |
| 16 <link rel="components" href="example/todomvc/todo_row.html"> | 20 <link rel="components" href="example/todomvc/todo_row.html"> |
| 17 <link rel="stylesheet" href="example/todomvc/base.css"> | 21 <link rel="stylesheet" href="example/todomvc/base.css"> |
| 18 <script type="application/javascript" src="testing.js"></script> | 22 <script type="application/javascript" src="testing.js"></script> |
| 23 <script type="application/javascript" src="start_dart.js"></script> |
| 19 <title>dart - TodoMVC</title> | 24 <title>dart - TodoMVC</title> |
| 20 </head> | 25 </head> |
| 21 <body> | 26 <body> |
| 22 <section id="todoapp"> | 27 <section id="todoapp"> |
| 23 <header id="header"> | 28 <header id="header"> |
| 24 <h1 class='title'>todos</h1> | 29 <h1 class='title'>todos</h1> |
| 25 <form on-submit="addTodo($event)"> | 30 <form on-submit="addTodo($event)"> |
| 26 <input id="new-todo" placeholder="What needs to be done?" autofocus | 31 <input id="new-todo" placeholder="What needs to be done?" autofocus |
| 27 on-change="addTodo($event)"> | 32 on-change="addTodo($event)"> |
| 28 </form> | 33 </form> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 or | 68 or |
| 64 <a href="https://github.com/dart-lang/web-ui/tree/master/example/todomvc">
view the source</a>. | 69 <a href="https://github.com/dart-lang/web-ui/tree/master/example/todomvc">
view the source</a>. |
| 65 </p> | 70 </p> |
| 66 <p>Part of <a href="http://todomvc.com">TodoMVC</a>.</p> | 71 <p>Part of <a href="http://todomvc.com">TodoMVC</a>.</p> |
| 67 </footer> | 72 </footer> |
| 68 <script type="application/dart"> | 73 <script type="application/dart"> |
| 69 import 'dart:html'; | 74 import 'dart:html'; |
| 70 import 'package:web_ui/web_ui.dart'; | 75 import 'package:web_ui/web_ui.dart'; |
| 71 import 'example/todomvc/main.dart' as todomvc_main; | 76 import 'example/todomvc/main.dart' as todomvc_main; |
| 72 import 'example/todomvc/model.dart'; | 77 import 'example/todomvc/model.dart'; |
| 78 import 'perf_common.dart'; |
| 79 import 'todomvc_common.dart'; |
| 73 | 80 |
| 74 final addTodo = todomvc_main.addTodo; | 81 final addTodo = todomvc_main.addTodo; |
| 75 | 82 |
| 76 main() { | 83 main() { |
| 84 useShadowDom = false; |
| 77 todomvc_main.main(); | 85 todomvc_main.main(); |
| 78 window.setTimeout(() { | 86 window.setTimeout(() { |
| 79 app.todos.add(new Todo('hola')); | 87 var bench = new TodoMvcBenchmark(); |
| 88 perfDone(bench.measure()); |
| 89 }, 0); |
| 90 } |
| 91 |
| 92 class TodoMvcBenchmark extends BenchmarkBase { |
| 93 TodoMvcBenchmark() : super('todomvc'); |
| 94 void run() { |
| 95 app.todos.clear(); |
| 80 dispatch(); | 96 dispatch(); |
| 81 window.setTimeout(() => window.postMessage('done', '*'), 0); | 97 addNote("one"); |
| 82 }, 0); | 98 addNote("two"); |
| 99 addNote("three"); |
| 100 addNote("four"); |
| 101 addNote("five"); |
| 102 markChecked(3); |
| 103 clearCompleted(); |
| 104 } |
| 83 } | 105 } |
| 84 </script> | 106 </script> |
| 85 </body> | 107 </body> |
| 86 </html> | 108 </html> |
| OLD | NEW |