Bug 1070268: Add findChildElements endpoint to Marionette for WebDriver compatibility; r=jgriffin

This commit is contained in:
David Burns 2014-09-25 15:42:35 +01:00
parent 2ffd310fa0
commit c8ca163495

View File

@ -1621,6 +1621,26 @@ MarionetteServerConnection.prototype = {
}
},
/**
* Find element using the indicated search strategy
* starting from a known element. Used for WebDriver Compatibility only.
* @param {object} aRequest
* 'using' member indicates which search method to use
* 'value' member is the value the client is looking for
* 'id' member is the value of the element to start from
*/
findChildElement: function MDA_findChildElement(aRequest) {
let command_id = this.command_id = this.getCommandId();
this.sendAsync("findElementContent",
{
value: aRequest.parameters.value,
using: aRequest.parameters.using,
element: aRequest.parameters.id,
searchTimeout: this.searchTimeout
},
command_id);
},
/**
* Find elements using the indicated search strategy.
*
@ -1660,6 +1680,26 @@ MarionetteServerConnection.prototype = {
}
},
/**
* Find elements using the indicated search strategy
* starting from a known element. Used for WebDriver Compatibility only.
* @param {object} aRequest
* 'using' member indicates which search method to use
* 'value' member is the value the client is looking for
* 'id' member is the value of the element to start from
*/
findChildElements: function MDA_findChildElement(aRequest) {
let command_id = this.command_id = this.getCommandId();
this.sendAsync("findElementsContent",
{
value: aRequest.parameters.value,
using: aRequest.parameters.using,
element: aRequest.parameters.id,
searchTimeout: this.searchTimeout
},
command_id);
},
/**
* Return the active element on the page
*/
@ -2615,7 +2655,9 @@ MarionetteServerConnection.prototype.requestTypes = {
"executeJSScript": MarionetteServerConnection.prototype.executeJSScript,
"setSearchTimeout": MarionetteServerConnection.prototype.setSearchTimeout,
"findElement": MarionetteServerConnection.prototype.findElement,
"findChildElement": MarionetteServerConnection.prototype.findChildElements, // Needed for WebDriver compat
"findElements": MarionetteServerConnection.prototype.findElements,
"findChildElements":MarionetteServerConnection.prototype.findChildElements, // Needed for WebDriver compat
"clickElement": MarionetteServerConnection.prototype.clickElement,
"getElementAttribute": MarionetteServerConnection.prototype.getElementAttribute,
"getElementText": MarionetteServerConnection.prototype.getElementText,