| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from telemetry import multi_page_benchmark | 5 from telemetry import multi_page_benchmark |
| 6 from telemetry import util | 6 from telemetry import util |
| 7 | 7 |
| 8 class RobohornetPro(multi_page_benchmark.MultiPageBenchmark): | 8 class RobohornetPro(multi_page_benchmark.MultiPageBenchmark): |
| 9 def CustomizeBrowserOptions(self, options): | 9 def CustomizeBrowserOptions(self, pages, options): |
| 10 # Benchmark require use of real Date.now() for measurement. | 10 # Benchmark require use of real Date.now() for measurement. |
| 11 options.wpr_make_javascript_deterministic = False | 11 options.wpr_make_javascript_deterministic = False |
| 12 | 12 |
| 13 def MeasurePage(self, _, tab, results): | 13 def MeasurePage(self, _, tab, results): |
| 14 tab.runtime.Execute('ToggleRoboHornet()') | 14 tab.runtime.Execute('ToggleRoboHornet()') |
| 15 | 15 |
| 16 done = 'document.getElementById("results").innerHTML.indexOf("Total") != -1' | 16 done = 'document.getElementById("results").innerHTML.indexOf("Total") != -1' |
| 17 def _IsDone(): | 17 def _IsDone(): |
| 18 return tab.runtime.Evaluate(done) | 18 return tab.runtime.Evaluate(done) |
| 19 util.WaitFor(_IsDone, 60) | 19 util.WaitFor(_IsDone, 60) |
| 20 | 20 |
| 21 result = int(tab.runtime.Evaluate('stopTime - startTime')) | 21 result = int(tab.runtime.Evaluate('stopTime - startTime')) |
| 22 results.Add('Total', 'ms', result) | 22 results.Add('Total', 'ms', result) |
| OLD | NEW |