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
8 class BrowserControlClickPage(page_module
.Page
):
10 """ Why: Use a JavaScript .click() call to attach and detach a DOM tree
11 from a basic document.
14 def __init__(self
, page_set
):
15 super(BrowserControlClickPage
, self
).__init
__(
16 url
='file://endure/browser_control_click.html',
18 name
='browser_control_click')
19 self
.user_agent_type
= 'desktop'
21 def RunNavigateSteps(self
, action_runner
):
22 action_runner
.NavigateToPage(self
)
23 action_runner
.WaitForElement('#attach')
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)
32 class BrowserControlClickPageSet(page_set_module
.PageSet
):
34 """ Chrome Endure control test for the browser. """
37 super(BrowserControlClickPageSet
, self
).__init
__(
38 user_agent_type
='desktop')
40 self
.AddPage(BrowserControlClickPage(self
))