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

Unified Diff: tools/telemetry/telemetry/click_element_action.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/click_element_action.py
diff --git a/tools/telemetry/telemetry/click_element_action.py b/tools/telemetry/telemetry/click_element_action.py
deleted file mode 100644
index eabc65bc79bf24ed0c89bd04dce6b72db7cf3b9f..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/click_element_action.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-from telemetry import inspector_runtime
-from telemetry import page as page_module
-from telemetry import page_action
-from telemetry import util
-
-class ClickElementAction(page_action.PageAction):
- def __init__(self, attributes=None):
- super(ClickElementAction, self).__init__(attributes)
-
- def RunAction(self, page, tab, previous_action):
- def DoClick():
- assert hasattr(self, 'selector') or hasattr(self, 'text')
- if hasattr(self, 'selector'):
- code = 'document.querySelector(\'' + self.selector + '\').click();'
- try:
- tab.ExecuteJavaScript(code)
- except inspector_runtime.EvaluateException:
- raise page_action.PageActionFailed(
- 'Cannot find element with selector ' + self.selector)
- else:
- callback_code = 'function(element) { element.click(); }'
- try:
- util.FindElementAndPerformAction(tab, self.text, callback_code)
- except inspector_runtime.EvaluateException:
- raise page_action.PageActionFailed(
- 'Cannot find element with text ' + self.text)
-
- if hasattr(self, 'wait_for_navigate'):
- tab.PerformActionAndWaitForNavigate(DoClick)
- elif hasattr(self, 'wait_for_href_change'):
- old_url = tab.EvaluateJavaScript('document.location.href')
- DoClick()
- util.WaitFor(lambda: tab.EvaluateJavaScript(
- 'document.location.href') != old_url, 60)
- else:
- DoClick()
-
- page_module.Page.WaitForPageToLoad(self, tab, 60)
- tab.WaitForDocumentReadyStateToBeInteractiveOrBetter()
« no previous file with comments | « tools/telemetry/telemetry/chromeos_login_ext/manifest.json ('k') | tools/telemetry/telemetry/click_element_action_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698