Bug 1197146: Part 7: Use dispatcher for listener isElementDisplayed

r=dburns

--HG--
extra : commitid : 4zgBxkq6zdO
extra : source : dbee5f882e8eb355ffdad4cd7f7a6dd51a06443f
This commit is contained in:
Andreas Tolfsen 2015-08-21 15:49:47 +01:00
Родитель 0a22490c2e
Коммит 3932cbc6d5
2 изменённых файлов: 13 добавлений и 14 удалений

Просмотреть файл

@ -2094,7 +2094,7 @@ GeckoDriver.prototype.isElementDisplayed = function(cmd, resp) {
break;
case Context.CONTENT:
resp.value = yield this.listener.isElementDisplayed({id: id});
resp.value = yield this.listener.isElementDisplayed(id);
break;
}
};

Просмотреть файл

@ -210,6 +210,7 @@ let findElementsContentFn = dispatch(findElementsContent);
let isElementSelectedFn = dispatch(isElementSelected);
let getElementLocationFn = dispatch(getElementLocation);
let clearElementFn = dispatch(clearElement);
let isElementDisplayedFn = dispatch(isElementDisplayed);
/**
* Start all message listeners
@ -239,7 +240,7 @@ function startListeners() {
addMessageListenerId("Marionette:getElementAttribute", getElementAttributeFn);
addMessageListenerId("Marionette:getElementText", getElementTextFn);
addMessageListenerId("Marionette:getElementTagName", getElementTagNameFn);
addMessageListenerId("Marionette:isElementDisplayed", isElementDisplayed);
addMessageListenerId("Marionette:isElementDisplayed", isElementDisplayedFn);
addMessageListenerId("Marionette:getElementValueOfCssProperty", getElementValueOfCssProperty);
addMessageListenerId("Marionette:getElementSize", getElementSizeFn); // deprecated
addMessageListenerId("Marionette:getElementRect", getElementRectFn);
@ -344,7 +345,7 @@ function deleteSession(msg) {
removeMessageListenerId("Marionette:getElementAttribute", getElementAttributeFn);
removeMessageListenerId("Marionette:getElementText", getElementTextFn);
removeMessageListenerId("Marionette:getElementTagName", getElementTagNameFn);
removeMessageListenerId("Marionette:isElementDisplayed", isElementDisplayed);
removeMessageListenerId("Marionette:isElementDisplayed", isElementDisplayedFn);
removeMessageListenerId("Marionette:getElementValueOfCssProperty", getElementValueOfCssProperty);
removeMessageListenerId("Marionette:getElementSize", getElementSizeFn); // deprecated
removeMessageListenerId("Marionette:getElementRect", getElementRectFn);
@ -1505,18 +1506,16 @@ function getElementTagName(id) {
}
/**
* Check if element is displayed
* Determine the element displayedness of the given web element.
*
* Also performs additional accessibility checks if enabled by session
* capability.
*/
function isElementDisplayed(msg) {
let command_id = msg.json.command_id;
try {
let el = elementManager.getKnownElement(msg.json.id, curFrame);
let displayed = utils.isElementDisplayed(el);
checkVisibleAccessibility(accessibility.getAccessibleObject(el), displayed);
sendResponse({value: displayed}, command_id);
} catch (e) {
sendError(e, command_id);
}
function isElementDisplayed(id) {
let el = elementManager.getKnownElement(id, curFrame);
let displayed = utils.isElementDisplayed(el);
checkVisibleAccessibility(accessibility.getAccessibleObject(el), displayed);
return displayed;
}
/**