[Android WebViewShell] Add inclusion test for webview exposed stable interfaces.
[chromium-blink-merge.git] / tools / perf / benchmarks / robohornet_pro.py
blob95b480cae97b0079caa851dc6faa86ec3498b002
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 core import perf_benchmark
11 from telemetry import benchmark
12 from telemetry import page as page_module
13 from telemetry.page import page_test
14 from telemetry import story
15 from telemetry.value import scalar
17 from metrics import power
20 class _RobohornetProMeasurement(page_test.PageTest):
21 def __init__(self):
22 super(_RobohornetProMeasurement, self).__init__()
23 self._power_metric = None
25 def CustomizeBrowserOptions(self, options):
26 power.PowerMetric.CustomizeBrowserOptions(options)
28 def WillStartBrowser(self, platform):
29 self._power_metric = power.PowerMetric(platform)
31 def DidNavigateToPage(self, page, tab):
32 self._power_metric.Start(page, tab)
34 def ValidateAndMeasurePage(self, page, tab, results):
35 tab.ExecuteJavaScript('ToggleRoboHornet()')
36 tab.WaitForJavaScriptExpression(
37 'document.getElementById("results").innerHTML.indexOf("Total") != -1',
38 600)
40 self._power_metric.Stop(page, tab)
41 self._power_metric.AddResults(tab, results)
43 result = int(tab.EvaluateJavaScript('stopTime - startTime'))
44 results.AddValue(
45 scalar.ScalarValue(results.current_page, 'Total', 'ms', result))
48 # We plan to remove this test because it doesn't give useful data, but
49 # we need to wait until Chrome OS can implement support for more helpful
50 # benchmarks.
51 @benchmark.Enabled('chromeos')
52 class RobohornetPro(perf_benchmark.PerfBenchmark):
53 """Milliseconds to complete the RoboHornetPro demo by Microsoft.
55 http://ie.microsoft.com/testdrive/performance/robohornetpro/
56 """
57 test = _RobohornetProMeasurement
59 @classmethod
60 def Name(cls):
61 return 'robohornet_pro'
63 def CreateStorySet(self, options):
64 ps = story.StorySet(
65 archive_data_file='../page_sets/data/robohornet_pro.json',
66 base_dir=os.path.dirname(os.path.abspath(__file__)),
67 cloud_storage_bucket=story.PARTNER_BUCKET)
68 ps.AddStory(page_module.Page(
69 'http://ie.microsoft.com/testdrive/performance/robohornetpro/',
70 ps, ps.base_dir,
71 # Measurement require use of real Date.now() for measurement.
72 make_javascript_deterministic=False))
73 return ps