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