| 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 legacy_page_test | 7 from telemetry.page import legacy_page_test |
| 8 from telemetry.value import scalar | 8 from telemetry.value import scalar |
| 9 | 9 |
| 10 import py_utils | 10 import py_utils |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 window.benchmark_results.done = true; | 45 window.benchmark_results.done = true; |
| 46 window.benchmark_results.results = value; | 46 window.benchmark_results.results = value; |
| 47 }, { | 47 }, { |
| 48 "record_repeat_count": {{ record_repeat_count }}, | 48 "record_repeat_count": {{ record_repeat_count }}, |
| 49 "rasterize_repeat_count": {{ rasterize_repeat_count }} | 49 "rasterize_repeat_count": {{ rasterize_repeat_count }} |
| 50 }); | 50 }); |
| 51 """, | 51 """, |
| 52 record_repeat_count=self._record_repeat, | 52 record_repeat_count=self._record_repeat, |
| 53 rasterize_repeat_count=self._rasterize_repeat) | 53 rasterize_repeat_count=self._rasterize_repeat) |
| 54 | 54 |
| 55 benchmark_id = tab.EvaluateJavaScript2('window.benchmark_results.id') | 55 # Evaluating this expression usually takes between 60 and 90 seconds. |
| 56 benchmark_id = tab.EvaluateJavaScript2( |
| 57 'window.benchmark_results.id', timeout=self._timeout) |
| 56 if not benchmark_id: | 58 if not benchmark_id: |
| 57 raise legacy_page_test.MeasurementFailure( | 59 raise legacy_page_test.MeasurementFailure( |
| 58 'Failed to schedule rasterize_and_record_micro') | 60 'Failed to schedule rasterize_and_record_micro') |
| 59 | 61 |
| 60 tab.WaitForJavaScriptCondition2( | 62 tab.WaitForJavaScriptCondition2( |
| 61 'window.benchmark_results.done', timeout=self._timeout) | 63 'window.benchmark_results.done', timeout=self._timeout) |
| 62 | 64 |
| 63 data = tab.EvaluateJavaScript2('window.benchmark_results.results') | 65 data = tab.EvaluateJavaScript2('window.benchmark_results.results') |
| 64 | 66 |
| 65 pixels_recorded = data['pixels_recorded'] | 67 pixels_recorded = data['pixels_recorded'] |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 results.current_page, 'total_layers', 'count', total_layers)) | 139 results.current_page, 'total_layers', 'count', total_layers)) |
| 138 results.AddValue(scalar.ScalarValue( | 140 results.AddValue(scalar.ScalarValue( |
| 139 results.current_page, 'total_picture_layers', 'count', | 141 results.current_page, 'total_picture_layers', 'count', |
| 140 total_picture_layers)) | 142 total_picture_layers)) |
| 141 results.AddValue(scalar.ScalarValue( | 143 results.AddValue(scalar.ScalarValue( |
| 142 results.current_page, 'total_picture_layers_with_no_content', 'count', | 144 results.current_page, 'total_picture_layers_with_no_content', 'count', |
| 143 total_picture_layers_with_no_content)) | 145 total_picture_layers_with_no_content)) |
| 144 results.AddValue(scalar.ScalarValue( | 146 results.AddValue(scalar.ScalarValue( |
| 145 results.current_page, 'total_picture_layers_off_screen', 'count', | 147 results.current_page, 'total_picture_layers_off_screen', 'count', |
| 146 total_picture_layers_off_screen)) | 148 total_picture_layers_off_screen)) |
| OLD | NEW |