| Index: test/perf/input/todomvc2_test.html
|
| diff --git a/test/data/input/todomvc_mainpage2_test.html b/test/perf/input/todomvc2_test.html
|
| similarity index 77%
|
| copy from test/data/input/todomvc_mainpage2_test.html
|
| copy to test/perf/input/todomvc2_test.html
|
| index 5068b36d3b0d4c421542d0c807a93ba94938c022..79f600f8333c5352e01b3c2ed55ca25b6ec6a99a 100644
|
| --- a/test/data/input/todomvc_mainpage2_test.html
|
| +++ b/test/perf/input/todomvc2_test.html
|
| @@ -7,15 +7,20 @@ BSD-style license that can be found in the LICENSE file.
|
| <html lang="en">
|
| <head>
|
| <!--
|
| - This test runs the TodoMVC app and evaluates that it renders correctly if a
|
| - single item is present in the todo list.
|
| + This performance test runs the TodoMVC app and uses the application as follows:
|
| + * on each iteration:
|
| + * clear all todos
|
| + * add 10 todos
|
| + * mark a couple as done
|
| + * clear-done (removes those marked as done).
|
| -->
|
| -<meta charset="utf-8">
|
| + <meta charset="utf-8">
|
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
| <link rel="components" href="example/todomvc/router_options.html">
|
| <link rel="components" href="example/todomvc/todo_row.html">
|
| <link rel="stylesheet" href="example/todomvc/base.css">
|
| <script type="application/javascript" src="testing.js"></script>
|
| + <script type="application/javascript" src="start_dart.js"></script>
|
| <title>dart - TodoMVC</title>
|
| </head>
|
| <body>
|
| @@ -67,20 +72,38 @@ BSD-style license that can be found in the LICENSE file.
|
| </footer>
|
| <script type="application/dart">
|
| import 'dart:html';
|
| +import 'package:unittest/unittest.dart';
|
| import 'package:web_ui/web_ui.dart';
|
| import 'example/todomvc/main.dart' as todomvc_main;
|
| import 'example/todomvc/model.dart';
|
| +import 'perf_common.dart';
|
| +import 'todomvc_common.dart';
|
|
|
| final addTodo = todomvc_main.addTodo;
|
|
|
| main() {
|
| + useShadowDom = false;
|
| todomvc_main.main();
|
| window.setTimeout(() {
|
| - app.todos.add(new Todo('hola'));
|
| - dispatch();
|
| - window.setTimeout(() => window.postMessage('done', '*'), 0);
|
| + var bench = new TodoMvcBenchmark();
|
| + perfDone(bench.measure());
|
| }, 0);
|
| }
|
| +
|
| +class TodoMvcBenchmark extends BenchmarkBase {
|
| + TodoMvcBenchmark() : super('todomvc-2');
|
| + void run() {
|
| + app.todos.clear();
|
| + dispatch();
|
| + for (int i = 0; i < 10; i++) {
|
| + addNote("item $i");
|
| + }
|
| + markChecked(0);
|
| + markChecked(4);
|
| + markChecked(8);
|
| + clearCompleted();
|
| + }
|
| +}
|
| </script>
|
| </body>
|
| </html>
|
|
|