| 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 |
| 11 from telemetry import benchmark | 11 from telemetry import benchmark |
| 12 from telemetry.core import util | 12 from telemetry.core import util |
| 13 from telemetry.page import page_measurement | 13 from telemetry.page import page_measurement |
| 14 from telemetry.page import page as page_module | 14 from telemetry.page import page as page_module |
| 15 from telemetry.page import page_set as page_set_module | 15 from telemetry.page import page_set as page_set_module |
| 16 # pylint: disable=W0401,W0614 | |
| 17 from telemetry.page.actions.all_page_actions import * | |
| 18 from telemetry.value import scalar | 16 from telemetry.value import scalar |
| 19 | 17 |
| 20 | 18 |
| 21 class _MapsMeasurement(page_measurement.PageMeasurement): | 19 class _MapsMeasurement(page_measurement.PageMeasurement): |
| 22 def MeasurePage(self, page, tab, results): | 20 def MeasurePage(self, page, tab, results): |
| 23 js_get_results = 'document.getElementsByTagName("pre")[0].innerText' | 21 js_get_results = 'document.getElementsByTagName("pre")[0].innerText' |
| 24 test_results = tab.EvaluateJavaScript(js_get_results) | 22 test_results = tab.EvaluateJavaScript(js_get_results) |
| 25 | 23 |
| 26 total = re.search('total=([0-9]+)', test_results).group(1) | 24 total = re.search('total=([0-9]+)', test_results).group(1) |
| 27 render = re.search('render=([0-9.]+),([0-9.]+)', test_results).group(2) | 25 render = re.search('render=([0-9.]+),([0-9.]+)', test_results).group(2) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 56 file_path=page_set_path) | 54 file_path=page_set_path) |
| 57 ps.AddPage(MapsPage(ps, ps.base_dir)) | 55 ps.AddPage(MapsPage(ps, ps.base_dir)) |
| 58 return ps | 56 return ps |
| 59 | 57 |
| 60 class MapsNoVsync(MapsBenchmark): | 58 class MapsNoVsync(MapsBenchmark): |
| 61 """Runs the Google Maps benchmark with Vsync disabled""" | 59 """Runs the Google Maps benchmark with Vsync disabled""" |
| 62 tag = 'novsync' | 60 tag = 'novsync' |
| 63 | 61 |
| 64 def CustomizeBrowserOptions(self, options): | 62 def CustomizeBrowserOptions(self, options): |
| 65 options.AppendExtraBrowserArgs('--disable-gpu-vsync') | 63 options.AppendExtraBrowserArgs('--disable-gpu-vsync') |
| OLD | NEW |