| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <!-- |
| 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 |
| 5 BSD-style license that can be found in the LICENSE file. |
| 6 --> |
| 7 <html lang="en"> |
| 8 <head> |
| 9 <!-- |
| 10 This performance test toggles a css class on each benchmark iteration. |
| 11 --> |
| 12 <meta charset="utf-8"> |
| 13 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 14 <script type="application/javascript" src="testing.js"></script> |
| 15 <script type="application/javascript" src="start_dart.js"></script> |
| 16 <style> |
| 17 .blue { color: #00F; } |
| 18 .red { color: #F00; } |
| 19 </style> |
| 20 </head> |
| 21 <body> |
| 22 <div class="{{color}}">x</div> |
| 23 <script type="application/dart"> |
| 24 import 'dart:html'; |
| 25 import 'package:web_ui/web_ui.dart'; |
| 26 import 'package:unittest/unittest.dart'; |
| 27 import 'perf_common.dart'; |
| 28 |
| 29 main() { |
| 30 useShadowDom = false; |
| 31 window.setTimeout(() { |
| 32 var bench = new CssBindingBenchmark(); |
| 33 perfDone(bench.measure()); |
| 34 }, 0); |
| 35 } |
| 36 |
| 37 String color; |
| 38 |
| 39 class CssBindingBenchmark extends BenchmarkBase { |
| 40 CssBindingBenchmark() : super('class-bind'); |
| 41 run() { |
| 42 if (color == null || color == 'blue') { |
| 43 color = 'red'; |
| 44 } else { |
| 45 color = 'blue'; |
| 46 } |
| 47 dispatch(); |
| 48 } |
| 49 } |
| 50 </script> |
| 51 </body> |
| 52 </html> |
| OLD | NEW |