Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / tools / perf / benchmarks / robohornet_pro.py
blob4709ef1422536e5bf2154494a9b06fd5e191b962
1 # Copyright 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """Runs Microsoft's RoboHornet Pro benchmark."""
7 import os
9 from metrics import power
10 from telemetry import benchmark
11 from telemetry.page import page_set
12 from telemetry.page import page_test
13 from telemetry.value import scalar
16 class _RobohornetProMeasurement(page_test.PageTest):
17 def __init__(self):
18 super(_RobohornetProMeasurement, self).__init__()
19 self._power_metric = None
21 def CustomizeBrowserOptions(self, options):
22 power.PowerMetric.CustomizeBrowserOptions(options)
24 def WillStartBrowser(self, platform):
25 self._power_metric = power.PowerMetric(platform)
27 def DidNavigateToPage(self, page, tab):
28 self._power_metric.Start(page, tab)
30 def ValidateAndMeasurePage(self, page, tab, results):
31 tab.ExecuteJavaScript('ToggleRoboHornet()')
32 tab.WaitForJavaScriptExpression(
33 'document.getElementById("results").innerHTML.indexOf("Total") != -1',
34 600)
36 self._power_metric.Stop(page, tab)
37 self._power_metric.AddResults(tab, results)
39 result = int(tab.EvaluateJavaScript('stopTime - startTime'))
40 results.AddValue(
41 scalar.ScalarValue(results.current_page, 'Total', 'ms', result))
45 class RobohornetPro(benchmark.Benchmark):
46 test = _RobohornetProMeasurement
48 def CreatePageSet(self, options):
49 ps = page_set.PageSet(
50 archive_data_file='../page_sets/data/robohornet_pro.json',
51 # Measurement require use of real Date.now() for measurement.
52 make_javascript_deterministic=False,
53 file_path=os.path.abspath(__file__))
54 ps.AddPageWithDefaultRunNavigate(
55 'http://ie.microsoft.com/testdrive/performance/robohornetpro/')
56 return ps