Bug 1155716: Part 1: Remove submitElement from Marionette

r=dburns
This commit is contained in:
Andreas Tolfsen 2015-04-29 11:31:19 +01:00
parent 57652b6e6e
commit 49ccec9ef2
2 changed files with 0 additions and 45 deletions

View File

@ -2087,25 +2087,6 @@ GeckoDriver.prototype.getElementValueOfCssProperty = function(cmd, resp) {
}
};
/**
* Submit a form on a content page by either using form or element in
* a form.
*
* @param {string} id
* Reference to the elemen that will be checked.
*/
GeckoDriver.prototype.submitElement = function(cmd, resp) {
switch (this.context) {
case Context.CHROME:
throw new WebDriverError(
"Command 'submitElement' is not available in chrome context");
case Context.CONTENT:
yield this.listener.submitElement({id: cmd.parameters.id});
break;
}
};
/**
* Check if element is enabled.
*
@ -2952,7 +2933,6 @@ GeckoDriver.prototype.commands = {
"getElementTagName": GeckoDriver.prototype.getElementTagName,
"isElementDisplayed": GeckoDriver.prototype.isElementDisplayed,
"getElementValueOfCssProperty": GeckoDriver.prototype.getElementValueOfCssProperty,
"submitElement": GeckoDriver.prototype.submitElement,
"getElementSize": GeckoDriver.prototype.getElementSize, //deprecated
"getElementRect": GeckoDriver.prototype.getElementRect,
"isElementEnabled": GeckoDriver.prototype.isElementEnabled,

View File

@ -221,7 +221,6 @@ function startListeners() {
addMessageListenerId("Marionette:getElementTagName", getElementTagNameFn);
addMessageListenerId("Marionette:isElementDisplayed", isElementDisplayed);
addMessageListenerId("Marionette:getElementValueOfCssProperty", getElementValueOfCssProperty);
addMessageListenerId("Marionette:submitElement", submitElement);
addMessageListenerId("Marionette:getElementSize", getElementSizeFn); // deprecated
addMessageListenerId("Marionette:getElementRect", getElementRectFn);
addMessageListenerId("Marionette:isElementEnabled", isElementEnabledFn);
@ -326,7 +325,6 @@ function deleteSession(msg) {
removeMessageListenerId("Marionette:getElementTagName", getElementTagNameFn);
removeMessageListenerId("Marionette:isElementDisplayed", isElementDisplayed);
removeMessageListenerId("Marionette:getElementValueOfCssProperty", getElementValueOfCssProperty);
removeMessageListenerId("Marionette:submitElement", submitElement);
removeMessageListenerId("Marionette:getElementSize", getElementSizeFn); // deprecated
removeMessageListenerId("Marionette:getElementRect", getElementRectFn);
removeMessageListenerId("Marionette:isElementEnabled", isElementEnabledFn);
@ -1454,29 +1452,6 @@ function getElementValueOfCssProperty(msg) {
}
}
/**
* Submit a form on a content page by either using form or element in a form
* @param object msg
* 'json' JSON object containing 'id' member of the element
*/
function submitElement (msg) {
let command_id = msg.json.command_id;
try {
let el = elementManager.getKnownElement(msg.json.id, curFrame);
while (el.parentNode != null && el.tagName.toLowerCase() != 'form') {
el = el.parentNode;
}
if (el.tagName && el.tagName.toLowerCase() == 'form') {
el.submit();
sendOk(command_id);
} else {
sendError(new NoSuchElementError("Element is not a form element or in a form"), command_id);
}
} catch (e) {
sendError(e, command_id);
}
}
/**
* Get the size of the element.
*