OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 from telemetry.page import page as page_module | 5 from telemetry.page import page as page_module |
6 from telemetry import story | 6 from telemetry import story |
7 | 7 |
8 class IndexedDBEndurePage(page_module.Page): | 8 class IndexedDBEndurePage(page_module.Page): |
9 | 9 |
10 def __init__(self, subtest, page_set): | 10 def __init__(self, subtest, page_set): |
11 super(IndexedDBEndurePage, self).__init__( | 11 super(IndexedDBEndurePage, self).__init__( |
12 url='file://indexeddb_perf/perf_test.html', | 12 url='file://indexeddb_perf/perf_test.html', |
13 page_set=page_set, | 13 page_set=page_set, |
14 name='indexeddb-endure-' + subtest) | 14 name='indexeddb-endure-' + subtest) |
15 self._subtest = subtest | 15 self._subtest = subtest |
16 | 16 |
17 def RunPageInteractions(self, action_runner): | 17 def RunPageInteractions(self, action_runner): |
18 # TODO(catapult:#3028): Fix interpolation of JavaScript values. | 18 action_runner.ExecuteJavaScript( |
19 action_runner.ExecuteJavaScript('window.testFilter = "' + | 19 'window.testFilter = {{ subtest }};', subtest=self._subtest) |
20 self._subtest + '";') | |
21 with action_runner.CreateInteraction('Action_Test'): | 20 with action_runner.CreateInteraction('Action_Test'): |
22 action_runner.ExecuteJavaScript('window.test();') | 21 action_runner.ExecuteJavaScript('window.test();') |
23 action_runner.WaitForJavaScriptCondition( | 22 action_runner.WaitForJavaScriptCondition( |
24 'window.done', timeout_in_seconds=600) | 23 'window.done', timeout_in_seconds=600) |
25 | 24 |
26 class IndexedDBEndurePageSet(story.StorySet): | 25 class IndexedDBEndurePageSet(story.StorySet): |
27 """The IndexedDB Endurance page set. | 26 """The IndexedDB Endurance page set. |
28 | 27 |
29 This page set exercises various common operations in IndexedDB. | 28 This page set exercises various common operations in IndexedDB. |
30 """ | 29 """ |
31 | 30 |
32 def __init__(self): | 31 def __init__(self): |
33 super(IndexedDBEndurePageSet, self).__init__() | 32 super(IndexedDBEndurePageSet, self).__init__() |
34 tests = [ | 33 tests = [ |
35 'testCreateAndDeleteDatabases', | 34 'testCreateAndDeleteDatabases', |
36 'testCreateAndDeleteDatabase', | 35 'testCreateAndDeleteDatabase', |
37 'testCreateKeysInStores', | 36 'testCreateKeysInStores', |
38 'testRandomReadsAndWritesWithoutIndex', | 37 'testRandomReadsAndWritesWithoutIndex', |
39 'testRandomReadsAndWritesWithIndex', | 38 'testRandomReadsAndWritesWithIndex', |
40 'testReadCacheWithoutIndex', | 39 'testReadCacheWithoutIndex', |
41 'testReadCacheWithIndex', | 40 'testReadCacheWithIndex', |
42 'testCreateAndDeleteIndex', | 41 'testCreateAndDeleteIndex', |
43 'testWalkingMultipleCursors', | 42 'testWalkingMultipleCursors', |
44 'testCursorSeeksWithoutIndex', | 43 'testCursorSeeksWithoutIndex', |
45 'testCursorSeeksWithIndex' | 44 'testCursorSeeksWithIndex' |
46 ] | 45 ] |
47 for test in tests: | 46 for test in tests: |
48 self.AddStory(IndexedDBEndurePage(test, self)) | 47 self.AddStory(IndexedDBEndurePage(test, self)) |
OLD | NEW |