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 import time | 5 import time |
6 | 6 |
7 from telemetry.page import page_test | 7 from telemetry.page import page_test |
8 from telemetry.value import scalar | 8 from telemetry.value import scalar |
9 | 9 |
10 from measurements import smoothness | 10 from measurements import smoothness |
11 | 11 |
12 | 12 |
13 class RecordPerArea(page_test.PageTest): | 13 class RecordPerArea(page_test.PageTest): |
14 def __init__(self, start_wait_time=2): | 14 def __init__(self, start_wait_time=2): |
15 super(RecordPerArea, self).__init__( | 15 super(RecordPerArea, self).__init__( |
16 needs_browser_restart_after_each_page=True) | 16 needs_browser_restart_after_each_page=True) |
17 self._start_wait_time = start_wait_time | 17 self._start_wait_time = start_wait_time |
18 | 18 |
19 def CustomizeBrowserOptions(self, options): | 19 def CustomizeBrowserOptions(self, options): |
20 smoothness.Smoothness.CustomizeBrowserOptions(options) | 20 smoothness.Smoothness.CustomizeBrowserOptions(options) |
21 options.AppendExtraBrowserArgs([ | 21 options.AppendExtraBrowserArgs([ |
22 '--enable-impl-side-painting', | 22 '--enable-impl-side-painting', |
23 '--enable-threaded-compositing', | 23 '--enable-threaded-compositing', |
24 '--enable-gpu-benchmarking' | 24 '--enable-gpu-benchmarking', |
25 # TODO(wkorman): Remove slimming paint disablement once we've sorted | |
26 # alternate testing. http://crbug.com/498936 | |
27 '--disable-slimming-paint' | |
aiolos (Not reviewing)
2015/06/11 19:49:11
Two questions:
1) What are you trying to do with
| |
25 ]) | 28 ]) |
26 | 29 |
27 def ValidateAndMeasurePage(self, page, tab, results): | 30 def ValidateAndMeasurePage(self, page, tab, results): |
28 # Wait until the page has loaded and come to a somewhat steady state. | 31 # Wait until the page has loaded and come to a somewhat steady state. |
29 # Needs to be adjusted for every device (~2 seconds for workstation). | 32 # Needs to be adjusted for every device (~2 seconds for workstation). |
30 time.sleep(self._start_wait_time) | 33 time.sleep(self._start_wait_time) |
31 | 34 |
32 # Enqueue benchmark | 35 # Enqueue benchmark |
33 tab.ExecuteJavaScript(""" | 36 tab.ExecuteJavaScript(""" |
34 window.benchmark_results = {}; | 37 window.benchmark_results = {}; |
(...skipping 17 matching lines...) Expand all Loading... | |
52 all_data = tab.EvaluateJavaScript('window.benchmark_results.results') | 55 all_data = tab.EvaluateJavaScript('window.benchmark_results.results') |
53 for data in all_data: | 56 for data in all_data: |
54 width = data['width'] | 57 width = data['width'] |
55 height = data['height'] | 58 height = data['height'] |
56 area = width * height | 59 area = width * height |
57 time_ms = data['time_ms'] | 60 time_ms = data['time_ms'] |
58 | 61 |
59 results.AddValue(scalar.ScalarValue( | 62 results.AddValue(scalar.ScalarValue( |
60 results.current_page, 'area_%07d_%dx%d' % (area, width, height), | 63 results.current_page, 'area_%07d_%dx%d' % (area, width, height), |
61 'ms', time_ms)) | 64 'ms', time_ms)) |
OLD | NEW |