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

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

Issue 321563003: Add Wait* API to ActionRunner to wrap over WaitAction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing to head. Created 6 years, 6 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
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 # pylint: disable=W0401,W0614 4 # pylint: disable=W0401,W0614
5 from telemetry.page.actions.all_page_actions import * 5 from telemetry.page.actions.all_page_actions import *
6 from telemetry.page import page as page_module 6 from telemetry.page import page as page_module
7 from telemetry.page import page_set as page_set_module 7 from telemetry.page import page_set as page_set_module
8 8
9 9
10 class BrowserControlClickPage(page_module.Page): 10 class BrowserControlClickPage(page_module.Page):
11 11
12 """ Why: Use a JavaScript .click() call to attach and detach a DOM tree 12 """ Why: Use a JavaScript .click() call to attach and detach a DOM tree
13 from a basic document. 13 from a basic document.
14 """ 14 """
15 15
16 def __init__(self, page_set): 16 def __init__(self, page_set):
17 super(BrowserControlClickPage, self).__init__( 17 super(BrowserControlClickPage, self).__init__(
18 url='file://endure/browser_control_click.html', 18 url='file://endure/browser_control_click.html',
19 page_set=page_set, 19 page_set=page_set,
20 name='browser_control_click') 20 name='browser_control_click')
21 self.user_agent_type = 'desktop' 21 self.user_agent_type = 'desktop'
22 22
23 def RunNavigateSteps(self, action_runner): 23 def RunNavigateSteps(self, action_runner):
24 action_runner.NavigateToPage(self) 24 action_runner.NavigateToPage(self)
25 action_runner.RunAction(WaitAction( 25 action_runner.WaitForElement('#attach')
26 {
27 'xpath': 'id("attach")',
28 'condition': 'element'
29 }))
30 26
31 def RunEndure(self, action_runner): 27 def RunEndure(self, action_runner):
32 action_runner.RunAction(ClickElementAction( 28 action_runner.RunAction(ClickElementAction(
33 { 29 {
34 'xpath': 'id("attach")' 30 'xpath': 'id("attach")'
35 })) 31 }))
36 action_runner.RunAction(WaitAction( 32 action_runner.Wait(0.5)
37 {
38 'seconds': 0.5
39 }))
40 action_runner.RunAction(ClickElementAction( 33 action_runner.RunAction(ClickElementAction(
41 { 34 {
42 'xpath': 'id("detach")' 35 'xpath': 'id("detach")'
43 })) 36 }))
44 action_runner.RunAction(WaitAction( 37 action_runner.Wait(0.5)
45 {
46 'seconds': 0.5
47 }))
48 38
49 39
50 class BrowserControlClickPageSet(page_set_module.PageSet): 40 class BrowserControlClickPageSet(page_set_module.PageSet):
51 41
52 """ Chrome Endure control test for the browser. """ 42 """ Chrome Endure control test for the browser. """
53 43
54 def __init__(self): 44 def __init__(self):
55 super(BrowserControlClickPageSet, self).__init__( 45 super(BrowserControlClickPageSet, self).__init__(
56 user_agent_type='desktop') 46 user_agent_type='desktop')
57 47
58 self.AddPage(BrowserControlClickPage(self)) 48 self.AddPage(BrowserControlClickPage(self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/browser_control.py ('k') | tools/perf/page_sets/calendar_forward_backward.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698