| 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 # 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.RunAction(NavigateAction()) | 24 action_runner.NavigateToPage(self) |
| 25 action_runner.RunAction(WaitAction( | 25 action_runner.RunAction(WaitAction( |
| 26 { | 26 { |
| 27 'xpath': 'id("attach")', | 27 'xpath': 'id("attach")', |
| 28 'condition': 'element' | 28 'condition': 'element' |
| 29 })) | 29 })) |
| 30 | 30 |
| 31 def RunEndure(self, action_runner): | 31 def RunEndure(self, action_runner): |
| 32 action_runner.RunAction(ClickElementAction( | 32 action_runner.RunAction(ClickElementAction( |
| 33 { | 33 { |
| 34 'xpath': 'id("attach")' | 34 'xpath': 'id("attach")' |
| (...skipping 14 matching lines...) Expand all Loading... |
| 49 | 49 |
| 50 class BrowserControlClickPageSet(page_set_module.PageSet): | 50 class BrowserControlClickPageSet(page_set_module.PageSet): |
| 51 | 51 |
| 52 """ Chrome Endure control test for the browser. """ | 52 """ Chrome Endure control test for the browser. """ |
| 53 | 53 |
| 54 def __init__(self): | 54 def __init__(self): |
| 55 super(BrowserControlClickPageSet, self).__init__( | 55 super(BrowserControlClickPageSet, self).__init__( |
| 56 user_agent_type='desktop') | 56 user_agent_type='desktop') |
| 57 | 57 |
| 58 self.AddPage(BrowserControlClickPage(self)) | 58 self.AddPage(BrowserControlClickPage(self)) |
| OLD | NEW |