OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 import re | 5 import re |
6 | 6 |
7 # pylint: disable=W0401,W0614 | 7 # pylint: disable=W0401,W0614 |
8 from telemetry.page.actions.all_page_actions import * | 8 from telemetry.page.actions.all_page_actions import * |
9 from telemetry.page import page as page_module | 9 from telemetry.page import page as page_module |
10 from telemetry.page import page_set as page_set_module | 10 from telemetry.page import page_set as page_set_module |
(...skipping 18 matching lines...) Expand all Loading... |
29 page_set=page_set, | 29 page_set=page_set, |
30 name='indexeddb_offline') | 30 name='indexeddb_offline') |
31 self.user_agent_type = 'desktop' | 31 self.user_agent_type = 'desktop' |
32 | 32 |
33 def RunNavigateSteps(self, action_runner): | 33 def RunNavigateSteps(self, action_runner): |
34 action_runner.NavigateToPage(self) | 34 action_runner.NavigateToPage(self) |
35 action_runner.WaitForElement(text='initialized') | 35 action_runner.WaitForElement(text='initialized') |
36 | 36 |
37 def RunEndure(self, action_runner): | 37 def RunEndure(self, action_runner): |
38 action_runner.WaitForElement('button[id="online"]:not(disabled)') | 38 action_runner.WaitForElement('button[id="online"]:not(disabled)') |
39 action_runner.RunAction(ClickElementAction( | 39 action_runner.ClickElement('button[id="online"]:not(disabled)') |
40 { | |
41 'selector': 'button[id="online"]:not(disabled)' | |
42 })) | |
43 action_runner.WaitForElement( | 40 action_runner.WaitForElement( |
44 element_function=_CreateXpathFunction('id("state")[text()="online"]')) | 41 element_function=_CreateXpathFunction('id("state")[text()="online"]')) |
45 action_runner.Wait(1) | 42 action_runner.Wait(1) |
46 action_runner.WaitForElement('button[id="offline"]:not(disabled)') | 43 action_runner.WaitForElement('button[id="offline"]:not(disabled)') |
47 action_runner.RunAction(ClickElementAction( | 44 action_runner.ClickElement('button[id="offline"]:not(disabled)') |
48 { | |
49 'selector': 'button[id="offline"]:not(disabled)' | |
50 })) | |
51 action_runner.WaitForElement( | 45 action_runner.WaitForElement( |
52 element_function=_CreateXpathFunction('id("state")[text()="offline"]')) | 46 element_function=_CreateXpathFunction('id("state")[text()="offline"]')) |
53 | 47 |
54 | 48 |
55 class IndexeddbOfflinePageSet(page_set_module.PageSet): | 49 class IndexeddbOfflinePageSet(page_set_module.PageSet): |
56 | 50 |
57 """ Chrome Endure test for IndexedDB. """ | 51 """ Chrome Endure test for IndexedDB. """ |
58 | 52 |
59 def __init__(self): | 53 def __init__(self): |
60 super(IndexeddbOfflinePageSet, self).__init__( | 54 super(IndexeddbOfflinePageSet, self).__init__( |
61 user_agent_type='desktop') | 55 user_agent_type='desktop') |
62 | 56 |
63 self.AddPage(IndexeddbOfflinePage(self)) | 57 self.AddPage(IndexeddbOfflinePage(self)) |
OLD | NEW |