| 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 measurements import smoothness | 7 from measurements import smoothness |
| 8 from telemetry.page import page_test | 8 from telemetry.page import page_test |
| 9 from telemetry.value import improvement_direction |
| 9 from telemetry.value import scalar | 10 from telemetry.value import scalar |
| 10 | 11 |
| 11 | 12 |
| 12 class RecordPerArea(page_test.PageTest): | 13 class RecordPerArea(page_test.PageTest): |
| 13 def __init__(self, start_wait_time=2): | 14 def __init__(self, start_wait_time=2): |
| 14 super(RecordPerArea, self).__init__('RunPageInteractions', True) | 15 super(RecordPerArea, self).__init__('RunPageInteractions', True) |
| 15 self._start_wait_time = start_wait_time | 16 self._start_wait_time = start_wait_time |
| 16 | 17 |
| 17 def CustomizeBrowserOptions(self, options): | 18 def CustomizeBrowserOptions(self, options): |
| 18 smoothness.Smoothness.CustomizeBrowserOptions(options) | 19 smoothness.Smoothness.CustomizeBrowserOptions(options) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 49 | 50 |
| 50 all_data = tab.EvaluateJavaScript('window.benchmark_results.results') | 51 all_data = tab.EvaluateJavaScript('window.benchmark_results.results') |
| 51 for data in all_data: | 52 for data in all_data: |
| 52 width = data['width'] | 53 width = data['width'] |
| 53 height = data['height'] | 54 height = data['height'] |
| 54 area = width * height | 55 area = width * height |
| 55 time_ms = data['time_ms'] | 56 time_ms = data['time_ms'] |
| 56 | 57 |
| 57 results.AddValue(scalar.ScalarValue( | 58 results.AddValue(scalar.ScalarValue( |
| 58 results.current_page, 'area_%07d_%dx%d' % (area, width, height), | 59 results.current_page, 'area_%07d_%dx%d' % (area, width, height), |
| 59 'ms', time_ms)) | 60 'ms', time_ms, improvement_direction=improvement_direction.DOWN)) |
| OLD | NEW |