Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: test/perf/input/todomvc_common.dart

Issue 11683002: Setting up benchmarks and perf utilities (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: john comments Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/perf/input/todomvc_async_test.html ('k') | test/perf/input/todomvc_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/perf/input/todomvc_common.dart
diff --git a/test/perf/input/todomvc_common.dart b/test/perf/input/todomvc_common.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5636af1c302ecd5eacb1c0cc719a9c69fd407a23
--- /dev/null
+++ b/test/perf/input/todomvc_common.dart
@@ -0,0 +1,34 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+/** Common functions used by TodoMVC tests. */
+library todomvc_common;
+
+import 'dart:html';
+import 'package:web_ui/watcher.dart';
+
+void markChecked(item) {
+ var node = document.queryAll('input[type=checkbox]')[item + 1];
+ node.on.click.dispatch(new MouseEvent('click', window, 1, 0, 0, 0, 0, 0));
+}
+
+void checkAll() {
+ var node = document.queryAll('input[type=checkbox]')[0];
+ node.on.click.dispatch(new MouseEvent('click', window, 1, 0, 0, 0, 0, 0));
+}
+
+void clearCompleted() {
+ var node = document.query('#clear-completed');
+ node.on.click.dispatch(new MouseEvent('click', window, 1, 0, 0, 0, 0, 0));
+}
+
+var _newTodo = (() => document.query('#new-todo'))();
+var _form = (() => document.query('#__e-0'))();
+
+void addNote(String note) {
+ _newTodo.value = note;
+ _form.on.submit.dispatch(new Event('submit'));
+ dispatch();
+}
« no previous file with comments | « test/perf/input/todomvc_async_test.html ('k') | test/perf/input/todomvc_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698