Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: tools/perf/page_sets/indexeddb_offline.py

Issue 616363002: Kill endure benchmark and all that related to it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes that remove --page-repeat Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2014 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 import re
6
7 from telemetry.page import page as page_module
8 from telemetry.page import page_set as page_set_module
9
10
11 def _CreateXpathFunction(xpath):
12 return ('document.evaluate("%s",'
13 'document,'
14 'null,'
15 'XPathResult.FIRST_ORDERED_NODE_TYPE,'
16 'null)'
17 '.singleNodeValue' % re.escape(xpath))
18
19
20 class IndexeddbOfflinePage(page_module.Page):
21
22 """ Why: Simulates user input while offline and sync while online. """
23
24 def __init__(self, page_set):
25 super(IndexeddbOfflinePage, self).__init__(
26 url='file://endure/indexeddb_app.html',
27 page_set=page_set,
28 name='indexeddb_offline')
29 self.user_agent_type = 'desktop'
30
31 def RunNavigateSteps(self, action_runner):
32 action_runner.NavigateToPage(self)
33 action_runner.WaitForElement(text='initialized')
34
35 def RunEndure(self, action_runner):
36 action_runner.WaitForElement('button[id="online"]:not(disabled)')
37 action_runner.ClickElement('button[id="online"]:not(disabled)')
38 action_runner.WaitForElement(
39 element_function=_CreateXpathFunction('id("state")[text()="online"]'))
40 action_runner.Wait(1)
41 action_runner.WaitForElement('button[id="offline"]:not(disabled)')
42 action_runner.ClickElement('button[id="offline"]:not(disabled)')
43 action_runner.WaitForElement(
44 element_function=_CreateXpathFunction('id("state")[text()="offline"]'))
45
46
47 class IndexeddbOfflinePageSet(page_set_module.PageSet):
48
49 """ Chrome Endure test for IndexedDB. """
50
51 def __init__(self):
52 super(IndexeddbOfflinePageSet, self).__init__(
53 user_agent_type='desktop')
54
55 self.AddPage(IndexeddbOfflinePage(self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/gmail_expand_collapse_conversation.py ('k') | tools/perf/page_sets/plus_alt_posts_photos.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698