Backed out 3 changesets (bug 941132, bug 941136, bug 961792) for breaking the Marionette harness. CLOSED TREE

Backed out changeset 301044380886 (bug 961792)
Backed out changeset 236a56500ef3 (bug 941132)
Backed out changeset 02130207774e (bug 941136)
This commit is contained in:
Ryan VanderMeulen 2014-01-21 14:47:41 -05:00
parent e041880100
commit 8f59cb59b9
3 changed files with 25 additions and 60 deletions

View File

@ -148,17 +148,10 @@ class HTMLElement(object):
@property
def location(self):
"""Get an element's location on the page.
The returned point will contain the x and y coordinates of the
top left-hand corner of the given element. The point (0,0)
refers to the upper-left corner of the document.
:returns: a dictionary containing x and y as entries
"""
return self.marionette._send_message("getElementLocation", "value", id=self.id)
'''
A dictionary with the x and y location of an element
'''
return self.marionette._send_message('getElementPosition', 'value', id=self.id)
def value_of_css_property(self, property_name):
'''
@ -875,20 +868,10 @@ class Marionette(object):
return response
def get_url(self):
"""Get a string representing the current URL.
On Desktop this returns a string representation of the URL of
the current top level browsing context. This is equivalent to
document.location.href.
When in the context of the chrome, this returns the canonical
URL of the current resource.
:returns: string representation of URL
"""
response = self._send_message("getCurrentUrl", "value")
'''
Returns the url of the active page in the browser.
'''
response = self._send_message('getUrl', 'value')
return response
def get_window_type(self):

View File

@ -131,7 +131,7 @@ function startListeners() {
addMessageListenerId("Marionette:actionChain", actionChain);
addMessageListenerId("Marionette:multiAction", multiAction);
addMessageListenerId("Marionette:goUrl", goUrl);
addMessageListenerId("Marionette:getCurrentUrl", getCurrentUrl);
addMessageListenerId("Marionette:getUrl", getUrl);
addMessageListenerId("Marionette:getTitle", getTitle);
addMessageListenerId("Marionette:getPageSource", getPageSource);
addMessageListenerId("Marionette:goBack", goBack);
@ -151,7 +151,7 @@ function startListeners() {
addMessageListenerId("Marionette:isElementEnabled", isElementEnabled);
addMessageListenerId("Marionette:isElementSelected", isElementSelected);
addMessageListenerId("Marionette:sendKeysToElement", sendKeysToElement);
addMessageListenerId("Marionette:getElementLocation", getElementLocation);
addMessageListenerId("Marionette:getElementPosition", getElementPosition);
addMessageListenerId("Marionette:clearElement", clearElement);
addMessageListenerId("Marionette:switchToFrame", switchToFrame);
addMessageListenerId("Marionette:deleteSession", deleteSession);
@ -234,7 +234,7 @@ function deleteSession(msg) {
removeMessageListenerId("Marionette:goUrl", goUrl);
removeMessageListenerId("Marionette:getTitle", getTitle);
removeMessageListenerId("Marionette:getPageSource", getPageSource);
removeMessageListenerId("Marionette:getCurrentUrl", getCurrentUrl);
removeMessageListenerId("Marionette:getUrl", getUrl);
removeMessageListenerId("Marionette:goBack", goBack);
removeMessageListenerId("Marionette:goForward", goForward);
removeMessageListenerId("Marionette:refresh", refresh);
@ -251,7 +251,7 @@ function deleteSession(msg) {
removeMessageListenerId("Marionette:isElementEnabled", isElementEnabled);
removeMessageListenerId("Marionette:isElementSelected", isElementSelected);
removeMessageListenerId("Marionette:sendKeysToElement", sendKeysToElement);
removeMessageListenerId("Marionette:getElementLocation", getElementLocation);
removeMessageListenerId("Marionette:getElementPosition", getElementPosition);
removeMessageListenerId("Marionette:clearElement", clearElement);
removeMessageListenerId("Marionette:switchToFrame", switchToFrame);
removeMessageListenerId("Marionette:deleteSession", deleteSession);
@ -1237,9 +1237,9 @@ function goUrl(msg) {
}
/**
* Get URL of the top level browsing context.
* Get the current URI
*/
function getCurrentUrl(msg) {
function getUrl(msg) {
sendResponse({value: curFrame.location.href}, msg.json.command_id);
}
@ -1708,11 +1708,11 @@ function sendKeysToElement(msg) {
}
/**
* Get the element's top left-hand corner point.
* Get the position of an element
*/
function getElementLocation(msg) {
function getElementPosition(msg) {
let command_id = msg.json.command_id;
try {
try{
let el = elementManager.getKnownElement(msg.json.id, curFrame);
let rect = el.getBoundingClientRect();

View File

@ -1079,22 +1079,15 @@ MarionetteServerConnection.prototype = {
},
/**
* Get a string representing the current URL.
*
* On Desktop this returns a string representation of the URL of the
* current top level browsing context. This is equivalent to
* document.location.href.
*
* When in the context of the chrome, this returns the canonical URL
* of the current resource.
* Gets current url
*/
getCurrentUrl: function MDA_getCurrentUrl() {
getUrl: function MDA_getUrl() {
this.command_id = this.getCommandId();
if (this.context == "chrome") {
this.sendResponse(this.getCurrentWindow().location.href, this.command_id);
}
else {
this.sendAsync("getCurrentUrl", {}, this.command_id);
this.sendAsync("getUrl", {}, this.command_id);
}
},
@ -1177,7 +1170,6 @@ MarionetteServerConnection.prototype = {
for (let i in this.browsers) {
if (this.curBrowser == this.browsers[i]) {
this.sendResponse(i, this.command_id);
return;
}
}
},
@ -1908,18 +1900,10 @@ MarionetteServerConnection.prototype = {
}
},
/**
* Get an element's location on the page.
*
* The returned point will contain the x and y coordinates of the
* top left-hand corner of the given element. The point (0,0)
* refers to the upper-left corner of the document.
*
* @return a point containing x and y coordinates as properties
*/
getElementLocation: function MDA_getElementLocation(aRequest) {
getElementPosition: function MDA_getElementPosition(aRequest) {
this.command_id = this.getCommandId();
this.sendAsync("getElementLocation", {id: aRequest.parameters.id},
this.sendAsync("getElementPosition",
{ id:aRequest.parameters.id },
this.command_id);
},
@ -2385,15 +2369,13 @@ MarionetteServerConnection.prototype.requestTypes = {
"isElementEnabled": MarionetteServerConnection.prototype.isElementEnabled,
"isElementSelected": MarionetteServerConnection.prototype.isElementSelected,
"sendKeysToElement": MarionetteServerConnection.prototype.sendKeysToElement,
"getElementLocation": MarionetteServerConnection.protocol.getElementLocation,
"getElementPosition": MarionetteServerConnection.prototype.getElementLocation, // deprecated
"getElementPosition": MarionetteServerConnection.prototype.getElementPosition,
"clearElement": MarionetteServerConnection.prototype.clearElement,
"getTitle": MarionetteServerConnection.prototype.getTitle,
"getWindowType": MarionetteServerConnection.prototype.getWindowType,
"getPageSource": MarionetteServerConnection.prototype.getPageSource,
"goUrl": MarionetteServerConnection.prototype.goUrl,
"getCurrentUrl": MarionetteServerConnection.prototype.getCurrentUrl,
"getUrl": MarionetteServerConnection.prototype.getCurrentUrl, // deprecated
"getUrl": MarionetteServerConnection.prototype.getUrl,
"goBack": MarionetteServerConnection.prototype.goBack,
"goForward": MarionetteServerConnection.prototype.goForward,
"refresh": MarionetteServerConnection.prototype.refresh,