[IndexedDB] Adding traces, perf tests
[chromium-blink-merge.git] / tools / perf / page_sets / indexeddb_endure_page.py
blob4910782a94d82705a1faf0ffbd44ef080f10e17f
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.
5 from telemetry.page import page as page_module
6 from telemetry import story
8 class IndexedDBEndurePage(page_module.Page):
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
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)
24 class IndexedDBEndurePageSet(story.StorySet):
25 """The IndexedDB Endurance page set.
27 This page set exercises various common operations in IndexedDB.
28 """
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'
45 for test in tests:
46 self.AddStory(IndexedDBEndurePage(test, self))