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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/click_element.js

Issue 11369075: Chrome remote control multipage tests: Add interactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactoring; add click_element.py, and js runner superclass for interactions. Created 8 years, 1 month 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/chrome_remote_control/chrome_remote_control/click_element.js
diff --git a/tools/chrome_remote_control/chrome_remote_control/click_element.js b/tools/chrome_remote_control/chrome_remote_control/click_element.js
new file mode 100644
index 0000000000000000000000000000000000000000..cebdc51fee610669fb2001df7e1ea05ef0151f69
--- /dev/null
+++ b/tools/chrome_remote_control/chrome_remote_control/click_element.js
@@ -0,0 +1,18 @@
+// 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.
nduca 2012/11/07 04:13:49 how about click_element_interaction.js? we'd of co
marja 2012/11/07 10:52:27 This file is removed, and I renamed the python fil
+
+// Inject this script on any page to click elements specified by a selector.
+
+(function() {
+ function clickElement(interaction) {
nduca 2012/11/07 04:13:49 I'm kind of skeptical why youre even injecting jav
marja 2012/11/07 10:52:27 Ok, this makes sense since the abstraction "all in
+ var element = document.querySelector(interaction['selector']);
+ if (element) {
+ element.click();
+ return true;
+ }
+ return false;
+ }
+
+ window.__clickElement = clickElement;
+})();

Powered by Google App Engine
This is Rietveld 408576698