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 # pylint: disable=W0401,W0614 5 from telemetry.page.actions.all_page_actions import * 6 from telemetry.page import page as page_module 7 from telemetry.page import page_set as page_set_module 8 9 10 class BrowserControlClickPage(page_module.Page): 11 12 """ Why: Use a JavaScript .click() call to attach and detach a DOM tree 13 from a basic document. 14 """ 15 16 def __init__(self, page_set): 17 super(BrowserControlClickPage, self).__init__( 18 url='file://endure/browser_control_click.html', 19 page_set=page_set, 20 name='browser_control_click') 21 self.user_agent_type = 'desktop' 22 23 def RunNavigateSteps(self, action_runner): 24 action_runner.NavigateToPage(self) 25 action_runner.WaitForElement('#attach') 26 27 def RunEndure(self, action_runner): 28 action_runner.ClickElement('#attach') 29 action_runner.Wait(0.5) 30 action_runner.ClickElement('#detach') 31 action_runner.Wait(0.5) 32 33 34 class BrowserControlClickPageSet(page_set_module.PageSet): 35 36 """ Chrome Endure control test for the browser. """ 37 38 def __init__(self): 39 super(BrowserControlClickPageSet, self).__init__( 40 user_agent_type='desktop') 41 42 self.AddPage(BrowserControlClickPage(self)) 43