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