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

Unified Diff: tools/telemetry/telemetry/internal/actions/mouse_click.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/internal/actions/mouse_click.py
diff --git a/tools/telemetry/telemetry/internal/actions/mouse_click.py b/tools/telemetry/telemetry/internal/actions/mouse_click.py
deleted file mode 100644
index 069afe887fe0835814105d43b08e5f50fd7a2790..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/actions/mouse_click.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2015 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.
-import os
-
-from telemetry.internal.actions import page_action
-
-
-def read_js():
- with open(os.path.join(os.path.dirname(__file__), 'mouse_click.js')) as f:
- return f.read()
-
-
-class MouseClickAction(page_action.PageAction):
- _MOUSE_CLICK_JAVASCRIPT = read_js()
-
- def __init__(self, selector=None):
- super(MouseClickAction, self).__init__()
- self._selector = selector
-
- def WillRunAction(self, tab):
- """Load the mouse click JS code prior to running the action."""
- super(MouseClickAction, self).WillRunAction(tab)
- tab.ExecuteJavaScript(MouseClickAction._MOUSE_CLICK_JAVASCRIPT)
- done_callback = 'function() { window.__mouseClickActionDone = true; }'
- tab.ExecuteJavaScript("""
- window.__mouseClickActionDone = false;
- window.__mouseClickAction = new __MouseClickAction(%s);"""
- % (done_callback))
-
- def RunAction(self, tab):
- code = '''
- function(element, info) {
- if (!element) {
- throw Error('Cannot find element: ' + info);
- }
- window.__mouseClickAction.start({
- element: element
- });
- }'''
- page_action.EvaluateCallbackWithElement(
- tab, code, selector=self._selector)
- tab.WaitForJavaScriptExpression('window.__mouseClickActionDone', 60)

Powered by Google App Engine
This is Rietveld 408576698