| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 a Google Maps performance test. | 5 """Runs a Google Maps performance test. |
| 6 Rerforms several common navigation actions on the map (pan, zoom, rotate)""" | 6 Rerforms several common navigation actions on the map (pan, zoom, rotate)""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 super(_MapsMeasurement, self).__init__( | 21 super(_MapsMeasurement, self).__init__( |
| 22 action_name_to_run='RunPageInteractions') | 22 action_name_to_run='RunPageInteractions') |
| 23 | 23 |
| 24 def ValidateAndMeasurePage(self, page, tab, results): | 24 def ValidateAndMeasurePage(self, page, tab, results): |
| 25 js_get_results = 'document.getElementsByTagName("pre")[0].innerText' | 25 js_get_results = 'document.getElementsByTagName("pre")[0].innerText' |
| 26 test_results = tab.EvaluateJavaScript(js_get_results) | 26 test_results = tab.EvaluateJavaScript(js_get_results) |
| 27 | 27 |
| 28 total = re.search('total=([0-9]+)', test_results).group(1) | 28 total = re.search('total=([0-9]+)', test_results).group(1) |
| 29 render = re.search('render=([0-9.]+),([0-9.]+)', test_results).group(2) | 29 render = re.search('render=([0-9.]+),([0-9.]+)', test_results).group(2) |
| 30 results.AddValue(scalar.ScalarValue( | 30 results.AddValue(scalar.ScalarValue( |
| 31 results.current_page, 'total_time', 'ms', total)) | 31 results.current_page, 'total_time', 'ms', int(total))) |
| 32 results.AddValue(scalar.ScalarValue( | 32 results.AddValue(scalar.ScalarValue( |
| 33 results.current_page, 'render_mean_time', 'ms', render)) | 33 results.current_page, 'render_mean_time', 'ms', float(render))) |
| 34 | 34 |
| 35 class MapsPage(page_module.Page): | 35 class MapsPage(page_module.Page): |
| 36 def __init__(self, page_set, base_dir): | 36 def __init__(self, page_set, base_dir): |
| 37 super(MapsPage, self).__init__( | 37 super(MapsPage, self).__init__( |
| 38 url='http://localhost:10020/tracker.html', | 38 url='http://localhost:10020/tracker.html', |
| 39 page_set=page_set, | 39 page_set=page_set, |
| 40 base_dir=base_dir, | 40 base_dir=base_dir, |
| 41 make_javascript_deterministic=False) | 41 make_javascript_deterministic=False) |
| 42 | 42 |
| 43 def RunNavigateSteps(self, action_runner): | 43 def RunNavigateSteps(self, action_runner): |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 class MapsNoVsync(MapsBenchmark): | 66 class MapsNoVsync(MapsBenchmark): |
| 67 """Runs the Google Maps benchmark with Vsync disabled""" | 67 """Runs the Google Maps benchmark with Vsync disabled""" |
| 68 tag = 'novsync' | 68 tag = 'novsync' |
| 69 | 69 |
| 70 @classmethod | 70 @classmethod |
| 71 def Name(cls): | 71 def Name(cls): |
| 72 return 'maps.novsync' | 72 return 'maps.novsync' |
| 73 | 73 |
| 74 def CustomizeBrowserOptions(self, options): | 74 def CustomizeBrowserOptions(self, options): |
| 75 options.AppendExtraBrowserArgs('--disable-gpu-vsync') | 75 options.AppendExtraBrowserArgs('--disable-gpu-vsync') |
| OLD | NEW |