Chromium Code Reviews| 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 10 todos | |
|
Jennifer Messerly
2013/01/07 21:07:46
what happens if we crank up the number of todos?
Siggi Cherem (dart-lang)
2013/01/08 02:26:18
it gets really slow, just running 10 iterations is
| |
| 14 * mark a couple as done | |
| 15 * clear-done (removes those 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"> |
|
Jennifer Messerly
2013/01/07 21:07:46
If it doesn't affect performance, could you pull t
Siggi Cherem (dart-lang)
2013/01/08 02:26:18
yeah, it might be a good idea to switch to that to
| |
| 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> |
| 29 </header> | 34 </header> |
| 30 <section id="main"> | 35 <section id="main"> |
| 31 <input id="toggle-all" type="checkbox" bind-checked="app.allChecked"> | 36 <input id="toggle-all" type="checkbox" bind-checked="app.allChecked"> |
| 32 <label for="toggle-all"></label> | 37 <label for="toggle-all"></label> |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 60 <p> | 65 <p> |
| 61 Learn more about | 66 Learn more about |
| 62 <a href="https://www.dartlang.org/articles/dart-web-components/">Dart + We b Components</a> | 67 <a href="https://www.dartlang.org/articles/dart-web-components/">Dart + We b Components</a> |
| 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'; |
| 75 import 'package:unittest/unittest.dart'; | |
| 70 import 'package:web_ui/web_ui.dart'; | 76 import 'package:web_ui/web_ui.dart'; |
| 71 import 'example/todomvc/main.dart' as todomvc_main; | 77 import 'example/todomvc/main.dart' as todomvc_main; |
| 72 import 'example/todomvc/model.dart'; | 78 import 'example/todomvc/model.dart'; |
| 79 import 'perf_common.dart'; | |
| 80 import 'todomvc_common.dart'; | |
| 73 | 81 |
| 74 final addTodo = todomvc_main.addTodo; | 82 final addTodo = todomvc_main.addTodo; |
| 75 | 83 |
| 76 main() { | 84 main() { |
| 85 useShadowDom = false; | |
| 77 todomvc_main.main(); | 86 todomvc_main.main(); |
| 78 window.setTimeout(() { | 87 window.setTimeout(() { |
| 79 app.todos.add(new Todo('hola')); | 88 var bench = new TodoMvcBenchmark(); |
| 89 perfDone(bench.measure()); | |
| 90 }, 0); | |
| 91 } | |
| 92 | |
| 93 class TodoMvcBenchmark extends BenchmarkBase { | |
| 94 TodoMvcBenchmark() : super('todomvc-2'); | |
| 95 void run() { | |
| 96 app.todos.clear(); | |
| 80 dispatch(); | 97 dispatch(); |
| 81 window.setTimeout(() => window.postMessage('done', '*'), 0); | 98 for (int i = 0; i < 10; i++) { |
| 82 }, 0); | 99 addNote("item $i"); |
| 100 } | |
| 101 markChecked(0); | |
| 102 markChecked(4); | |
| 103 markChecked(8); | |
| 104 clearCompleted(); | |
| 105 } | |
| 83 } | 106 } |
| 84 </script> | 107 </script> |
| 85 </body> | 108 </body> |
| 86 </html> | 109 </html> |
| OLD | NEW |