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

Unified Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 1365433002: Add setSelection function to automation API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nobrailleautostartintests
Patch Set: Change setDocumentSelection to take named arguments. Created 5 years, 2 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: chrome/renderer/resources/extensions/automation/automation_node.js
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js
index a8dcdf63fb28af724447a3be800e5136fb339b18..ed76dcd596d4d67355ae9627c5913ee2f257a48e 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -244,9 +244,12 @@ AutomationNodeImpl.prototype = {
},
setSelection: function(startIndex, endIndex) {
- this.performAction_('setSelection',
- { startIndex: startIndex,
- endIndex: endIndex });
+ if (this.role == 'textField' || this.role == 'textBox') {
+ this.performAction_('setSelection',
+ { focusNodeID: this.id,
+ anchorOffset: startIndex,
+ focusOffset: endIndex });
+ }
},
showContextMenu: function() {

Powered by Google App Engine
This is Rietveld 408576698