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

Unified Diff: test/perf/input/class_binding_test.html

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/bindings_test.html ('k') | test/perf/input/create_100_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/perf/input/class_binding_test.html
diff --git a/test/perf/input/class_binding_test.html b/test/perf/input/class_binding_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..973b305fff5c489c48440c53acbca252b9a5cd43
--- /dev/null
+++ b/test/perf/input/class_binding_test.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<!--
+Copyright (c) 2012, 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.
+-->
+<html lang="en">
+<head>
+<!--
+ This performance test toggles a css class on each benchmark iteration.
+ -->
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <script type="application/javascript" src="testing.js"></script>
+ <script type="application/javascript" src="start_dart.js"></script>
+ <style>
+ .blue { color: #00F; }
+ .red { color: #F00; }
+ </style>
+</head>
+<body>
+ <div class="{{color}}">x</div>
+ <script type="application/dart">
+import 'dart:html';
+import 'package:web_ui/web_ui.dart';
+import 'package:unittest/unittest.dart';
+import 'perf_common.dart';
+
+main() {
+ useShadowDom = false;
+ window.setTimeout(() {
+ var bench = new CssBindingBenchmark();
+ perfDone(bench.measure());
+ }, 0);
+}
+
+String color;
+
+class CssBindingBenchmark extends BenchmarkBase {
+ CssBindingBenchmark() : super('class-bind');
+ run() {
+ if (color == null || color == 'blue') {
+ color = 'red';
+ } else {
+ color = 'blue';
+ }
+ dispatch();
+ }
+}
+ </script>
+</body>
+</html>
« no previous file with comments | « test/perf/input/bindings_test.html ('k') | test/perf/input/create_100_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698