| OLD | NEW |
| 1 # Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 """Runs Microsoft's RoboHornet Pro benchmark.""" | 5 """Runs Microsoft's RoboHornet Pro benchmark.""" |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 | 8 |
| 9 from core import perf_benchmark | 9 from core import perf_benchmark |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 def CustomizeBrowserOptions(self, options): | 26 def CustomizeBrowserOptions(self, options): |
| 27 power.PowerMetric.CustomizeBrowserOptions(options) | 27 power.PowerMetric.CustomizeBrowserOptions(options) |
| 28 | 28 |
| 29 def WillStartBrowser(self, platform): | 29 def WillStartBrowser(self, platform): |
| 30 self._power_metric = power.PowerMetric(platform) | 30 self._power_metric = power.PowerMetric(platform) |
| 31 | 31 |
| 32 def DidNavigateToPage(self, page, tab): | 32 def DidNavigateToPage(self, page, tab): |
| 33 self._power_metric.Start(page, tab) | 33 self._power_metric.Start(page, tab) |
| 34 | 34 |
| 35 def ValidateAndMeasurePage(self, page, tab, results): | 35 def ValidateAndMeasurePage(self, page, tab, results): |
| 36 tab.ExecuteJavaScript2('ToggleRoboHornet()') | 36 tab.ExecuteJavaScript('ToggleRoboHornet()') |
| 37 tab.WaitForJavaScriptCondition2( | 37 tab.WaitForJavaScriptCondition( |
| 38 'document.getElementById("results").innerHTML.indexOf("Total") != -1', | 38 'document.getElementById("results").innerHTML.indexOf("Total") != -1', |
| 39 timeout=600) | 39 timeout=600) |
| 40 | 40 |
| 41 self._power_metric.Stop(page, tab) | 41 self._power_metric.Stop(page, tab) |
| 42 self._power_metric.AddResults(tab, results) | 42 self._power_metric.AddResults(tab, results) |
| 43 | 43 |
| 44 result = int(tab.EvaluateJavaScript2('stopTime - startTime')) | 44 result = int(tab.EvaluateJavaScript('stopTime - startTime')) |
| 45 results.AddValue( | 45 results.AddValue( |
| 46 scalar.ScalarValue(results.current_page, 'Total', 'ms', result)) | 46 scalar.ScalarValue(results.current_page, 'Total', 'ms', result)) |
| 47 | 47 |
| 48 | 48 |
| 49 # We plan to remove this test because it doesn't give useful data, but | 49 # We plan to remove this test because it doesn't give useful data, but |
| 50 # we need to wait until Chrome OS can implement support for more helpful | 50 # we need to wait until Chrome OS can implement support for more helpful |
| 51 # benchmarks. | 51 # benchmarks. |
| 52 @benchmark.Enabled('chromeos') | 52 @benchmark.Enabled('chromeos') |
| 53 class RobohornetPro(perf_benchmark.PerfBenchmark): | 53 class RobohornetPro(perf_benchmark.PerfBenchmark): |
| 54 """Milliseconds to complete the RoboHornetPro demo by Microsoft. | 54 """Milliseconds to complete the RoboHornetPro demo by Microsoft. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 65 ps = story.StorySet( | 65 ps = story.StorySet( |
| 66 archive_data_file='../page_sets/data/robohornet_pro.json', | 66 archive_data_file='../page_sets/data/robohornet_pro.json', |
| 67 base_dir=os.path.dirname(os.path.abspath(__file__)), | 67 base_dir=os.path.dirname(os.path.abspath(__file__)), |
| 68 cloud_storage_bucket=story.PARTNER_BUCKET) | 68 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 69 ps.AddStory(page_module.Page( | 69 ps.AddStory(page_module.Page( |
| 70 'http://ie.microsoft.com/testdrive/performance/robohornetpro/', | 70 'http://ie.microsoft.com/testdrive/performance/robohornetpro/', |
| 71 ps, ps.base_dir, | 71 ps, ps.base_dir, |
| 72 # Measurement require use of real Date.now() for measurement. | 72 # Measurement require use of real Date.now() for measurement. |
| 73 make_javascript_deterministic=False)) | 73 make_javascript_deterministic=False)) |
| 74 return ps | 74 return ps |
| OLD | NEW |