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 Chromium's IndexedDB performance test. These test: | 5 """Runs Chromium's IndexedDB performance test. These test: |
6 | 6 |
7 Databases: | 7 Databases: |
8 create/delete | 8 create/delete |
9 Keys: | 9 Keys: |
10 create/delete | 10 create/delete |
(...skipping 24 matching lines...) Expand all Loading... |
35 'V8.OsMemoryAllocated', | 35 'V8.OsMemoryAllocated', |
36 ] | 36 ] |
37 | 37 |
38 class _IndexedDbMeasurement(page_test.PageTest): | 38 class _IndexedDbMeasurement(page_test.PageTest): |
39 def __init__(self, *args, **kwargs): | 39 def __init__(self, *args, **kwargs): |
40 super(_IndexedDbMeasurement, self).__init__(*args, **kwargs) | 40 super(_IndexedDbMeasurement, self).__init__(*args, **kwargs) |
41 self._memory_metric = None | 41 self._memory_metric = None |
42 self._power_metric = None | 42 self._power_metric = None |
43 self._v8_object_stats_metric = None | 43 self._v8_object_stats_metric = None |
44 | 44 |
45 def WillStartBrowser(self, platform): | 45 def WillStartBrowser(self, browser): |
46 """Initialize metrics once right before the browser has been launched.""" | 46 """Initialize metrics once right before the browser has been launched.""" |
47 self._power_metric = power.PowerMetric(platform) | 47 self._power_metric = power.PowerMetric(browser) |
48 | 48 |
49 def DidStartBrowser(self, browser): | 49 def DidStartBrowser(self, browser): |
50 """Initialize metrics once right after the browser has been launched.""" | 50 """Initialize metrics once right after the browser has been launched.""" |
51 self._memory_metric = memory.MemoryMetric(browser) | 51 self._memory_metric = memory.MemoryMetric(browser) |
52 self._v8_object_stats_metric = ( | 52 self._v8_object_stats_metric = ( |
53 v8_object_stats.V8ObjectStatsMetric(_V8_COUNTER_NAMES)) | 53 v8_object_stats.V8ObjectStatsMetric(_V8_COUNTER_NAMES)) |
54 | 54 |
55 def DidNavigateToPage(self, page, tab): | 55 def DidNavigateToPage(self, page, tab): |
56 self._memory_metric.Start(page, tab) | 56 self._memory_metric.Start(page, tab) |
57 self._power_metric.Start(page, tab) | 57 self._power_metric.Start(page, tab) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 class IndexedDb(benchmark.Benchmark): | 93 class IndexedDb(benchmark.Benchmark): |
94 """Chromium's IndexedDB Performance tests.""" | 94 """Chromium's IndexedDB Performance tests.""" |
95 test = _IndexedDbMeasurement | 95 test = _IndexedDbMeasurement |
96 | 96 |
97 def CreatePageSet(self, options): | 97 def CreatePageSet(self, options): |
98 indexeddb_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', | 98 indexeddb_dir = os.path.join(util.GetChromiumSrcDir(), 'chrome', 'test', |
99 'data', 'indexeddb') | 99 'data', 'indexeddb') |
100 ps = page_set.PageSet(file_path=indexeddb_dir) | 100 ps = page_set.PageSet(file_path=indexeddb_dir) |
101 ps.AddPageWithDefaultRunNavigate('file://perf_test.html') | 101 ps.AddPageWithDefaultRunNavigate('file://perf_test.html') |
102 return ps | 102 return ps |
OLD | NEW |