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 # TODO(catapult:#3028): Fix interpolation of JavaScript values. |
19 action_runner.ExecuteJavaScript('window.testFilter = "' + | 19 action_runner.ExecuteJavaScript('window.testFilter = "' + |
20 self._subtest + '";') | 20 self._subtest + '";') |
21 with action_runner.CreateInteraction('Action_Test'): | 21 with action_runner.CreateInteraction('Action_Test'): |
22 action_runner.ExecuteJavaScript('window.test();') | 22 action_runner.ExecuteJavaScript('window.test();') |
23 action_runner.WaitForJavaScriptCondition('window.done', 600) | 23 action_runner.WaitForJavaScriptCondition( |
| 24 'window.done', timeout_in_seconds=600) |
24 | 25 |
25 class IndexedDBEndurePageSet(story.StorySet): | 26 class IndexedDBEndurePageSet(story.StorySet): |
26 """The IndexedDB Endurance page set. | 27 """The IndexedDB Endurance page set. |
27 | 28 |
28 This page set exercises various common operations in IndexedDB. | 29 This page set exercises various common operations in IndexedDB. |
29 """ | 30 """ |
30 | 31 |
31 def __init__(self): | 32 def __init__(self): |
32 super(IndexedDBEndurePageSet, self).__init__() | 33 super(IndexedDBEndurePageSet, self).__init__() |
33 tests = [ | 34 tests = [ |
34 'testCreateAndDeleteDatabases', | 35 'testCreateAndDeleteDatabases', |
35 'testCreateAndDeleteDatabase', | 36 'testCreateAndDeleteDatabase', |
36 'testCreateKeysInStores', | 37 'testCreateKeysInStores', |
37 'testRandomReadsAndWritesWithoutIndex', | 38 'testRandomReadsAndWritesWithoutIndex', |
38 'testRandomReadsAndWritesWithIndex', | 39 'testRandomReadsAndWritesWithIndex', |
39 'testReadCacheWithoutIndex', | 40 'testReadCacheWithoutIndex', |
40 'testReadCacheWithIndex', | 41 'testReadCacheWithIndex', |
41 'testCreateAndDeleteIndex', | 42 'testCreateAndDeleteIndex', |
42 'testWalkingMultipleCursors', | 43 'testWalkingMultipleCursors', |
43 'testCursorSeeksWithoutIndex', | 44 'testCursorSeeksWithoutIndex', |
44 'testCursorSeeksWithIndex' | 45 'testCursorSeeksWithIndex' |
45 ] | 46 ] |
46 for test in tests: | 47 for test in tests: |
47 self.AddStory(IndexedDBEndurePage(test, self)) | 48 self.AddStory(IndexedDBEndurePage(test, self)) |
OLD | NEW |