OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 import memory_test_expectations | 4 import memory_test_expectations |
5 import page_sets | 5 import page_sets |
6 | 6 |
7 from telemetry import benchmark | 7 from telemetry import benchmark |
8 from telemetry.page import page_test | 8 from telemetry.page import page_test |
9 from telemetry.core.platform import tracing_category_filter | 9 from telemetry.core.platform import tracing_category_filter |
10 from telemetry.core.platform import tracing_options | 10 from telemetry.core.platform import tracing_options |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 tab.browser.platform.tracing_controller.Start(options, category_filter, 60) | 96 tab.browser.platform.tracing_controller.Start(options, category_filter, 60) |
97 | 97 |
98 def _FormatException(self, low_or_high, mb_used): | 98 def _FormatException(self, low_or_high, mb_used): |
99 return 'Memory allocation too %s (was %d MB, should be %d MB +/- %d MB)' % ( | 99 return 'Memory allocation too %s (was %d MB, should be %d MB +/- %d MB)' % ( |
100 low_or_high, mb_used, SINGLE_TAB_LIMIT_MB, WIGGLE_ROOM_MB) | 100 low_or_high, mb_used, SINGLE_TAB_LIMIT_MB, WIGGLE_ROOM_MB) |
101 | 101 |
102 class MemoryTest(benchmark.Benchmark): | 102 class MemoryTest(benchmark.Benchmark): |
103 """Tests GPU memory limits""" | 103 """Tests GPU memory limits""" |
104 test = _MemoryValidator | 104 test = _MemoryValidator |
105 | 105 |
106 def CreateExpectations(self, page_set): | 106 def CreateExpectations(self): |
107 return memory_test_expectations.MemoryTestExpectations() | 107 return memory_test_expectations.MemoryTestExpectations() |
108 | 108 |
109 def CreatePageSet(self, options): | 109 def CreatePageSet(self, options): |
110 page_set = page_sets.MemoryTestsPageSet() | 110 page_set = page_sets.MemoryTestsPageSet() |
111 for page in page_set.pages: | 111 for page in page_set.pages: |
112 page.script_to_evaluate_on_commit = test_harness_script | 112 page.script_to_evaluate_on_commit = test_harness_script |
113 return page_set | 113 return page_set |
OLD | NEW |