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 * adds 10 todos once. |
| 12 * on each benchmark iteration update the text on one of them. | |
| 12 --> | 13 --> |
| 13 <meta charset="utf-8"> | 14 <meta charset="utf-8"> |
| 14 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 15 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 15 <link rel="components" href="example/todomvc/router_options.html"> | 16 <link rel="components" href="example/todomvc/router_options.html"> |
| 16 <link rel="components" href="example/todomvc/todo_row.html"> | 17 <link rel="components" href="example/todomvc/todo_row.html"> |
| 17 <link rel="stylesheet" href="example/todomvc/base.css"> | 18 <link rel="stylesheet" href="example/todomvc/base.css"> |
| 18 <script type="application/javascript" src="testing.js"></script> | 19 <script type="application/javascript" src="testing.js"></script> |
| 20 <script type="application/javascript" src="start_dart.js"></script> | |
| 19 <title>dart - TodoMVC</title> | 21 <title>dart - TodoMVC</title> |
| 20 </head> | 22 </head> |
| 21 <body> | 23 <body> |
| 22 <section id="todoapp"> | 24 <section id="todoapp"> |
| 23 <header id="header"> | 25 <header id="header"> |
| 24 <h1 class='title'>todos</h1> | 26 <h1 class='title'>todos</h1> |
| 25 <form on-submit="addTodo($event)"> | 27 <form on-submit="addTodo($event)"> |
| 26 <input id="new-todo" placeholder="What needs to be done?" autofocus | 28 <input id="new-todo" placeholder="What needs to be done?" autofocus |
| 27 on-change="addTodo($event)"> | 29 on-change="addTodo($event)"> |
| 28 </form> | 30 </form> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 <p> | 62 <p> |
| 61 Learn more about | 63 Learn more about |
| 62 <a href="https://www.dartlang.org/articles/dart-web-components/">Dart + We b Components</a> | 64 <a href="https://www.dartlang.org/articles/dart-web-components/">Dart + We b Components</a> |
| 63 or | 65 or |
| 64 <a href="https://github.com/dart-lang/web-ui/tree/master/example/todomvc"> view the source</a>. | 66 <a href="https://github.com/dart-lang/web-ui/tree/master/example/todomvc"> view the source</a>. |
| 65 </p> | 67 </p> |
| 66 <p>Part of <a href="http://todomvc.com">TodoMVC</a>.</p> | 68 <p>Part of <a href="http://todomvc.com">TodoMVC</a>.</p> |
| 67 </footer> | 69 </footer> |
| 68 <script type="application/dart"> | 70 <script type="application/dart"> |
| 69 import 'dart:html'; | 71 import 'dart:html'; |
| 72 import 'package:unittest/unittest.dart'; | |
| 70 import 'package:web_ui/web_ui.dart'; | 73 import 'package:web_ui/web_ui.dart'; |
| 71 import 'example/todomvc/main.dart' as todomvc_main; | 74 import 'example/todomvc/main.dart' as todomvc_main; |
| 72 import 'example/todomvc/model.dart'; | 75 import 'example/todomvc/model.dart'; |
| 76 import 'perf_common.dart'; | |
| 77 import 'todomvc_common.dart'; | |
| 73 | 78 |
| 74 final addTodo = todomvc_main.addTodo; | 79 final addTodo = todomvc_main.addTodo; |
| 75 | 80 |
| 76 main() { | 81 main() { |
| 82 useShadowDom = false; | |
| 77 todomvc_main.main(); | 83 todomvc_main.main(); |
| 78 window.setTimeout(() { | 84 window.setTimeout(() { |
| 79 app.todos.add(new Todo('hola')); | 85 var bench = new TodoMvcBenchmark(); |
| 86 perfDone(bench.measure()); | |
| 87 }, 0); | |
| 88 } | |
| 89 | |
| 90 class TodoMvcBenchmark extends BenchmarkBase { | |
|
Jennifer Messerly
2013/01/07 21:07:46
Minor comment about benchmark library:
generally w
Siggi Cherem (dart-lang)
2013/01/08 02:26:18
Yeah, when I had cloned that code here (patch #5 i
| |
| 91 TodoMvcBenchmark() : super('todomvc3'); | |
| 92 void setup() { | |
| 93 app.todos.clear(); | |
| 94 for (int i = 0; i < 10; i++) { | |
| 95 addNote("item $i"); | |
| 96 } | |
| 97 count = 0; | |
| 98 } | |
| 99 | |
| 100 int count; | |
| 101 void run() { | |
| 102 count++; | |
| 103 app.todos[3].task = 'item 4: $count'; | |
| 80 dispatch(); | 104 dispatch(); |
| 81 window.setTimeout(() => window.postMessage('done', '*'), 0); | 105 } |
| 82 }, 0); | |
| 83 } | 106 } |
| 84 </script> | 107 </script> |
| 85 </body> | 108 </body> |
| 86 </html> | 109 </html> |
| OLD | NEW |