Bug 1197143: Use dispatcher for listener goBack
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 21 Aug 2015 11:19:53 +0100
changeset 258972 f8b3d9a3d5771e23cd99f899315831b97c774a92
parent 258971 57971eca1e298f83a6dc1f0421219da8c6c6bc61
child 258973 d3c1a726529692b0ea8cf672539683820894c5f7
push id64097
push useratolfsen@mozilla.com
push dateMon, 24 Aug 2015 12:32:10 +0000
treeherdermozilla-inbound@f8b3d9a3d577 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1197143
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1197143: Use dispatcher for listener goBack r=dburns
testing/marionette/listener.js
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -183,16 +183,17 @@ function removeMessageListenerId(message
   removeMessageListener(messageName + listenerId, handler);
 }
 
 let getTitleFn = dispatch(getTitle);
 let getElementSizeFn = dispatch(getElementSize);
 let getPageSourceFn = dispatch(getPageSource);
 let getActiveElementFn = dispatch(getActiveElement);
 let clickElementFn = dispatch(clickElement);
+let goBackFn = dispatch(goBack);
 let getElementAttributeFn = dispatch(getElementAttribute);
 let getElementTextFn = dispatch(getElementText);
 let getElementTagNameFn = dispatch(getElementTagName);
 let getElementRectFn = dispatch(getElementRect);
 let isElementEnabledFn = dispatch(isElementEnabled);
 let getCurrentUrlFn = dispatch(getCurrentUrl);
 
 /**
@@ -208,17 +209,17 @@ function startListeners() {
   addMessageListenerId("Marionette:actionChain", actionChain);
   addMessageListenerId("Marionette:multiAction", multiAction);
   addMessageListenerId("Marionette:get", get);
   addMessageListenerId("Marionette:pollForReadyState", pollForReadyState);
   addMessageListenerId("Marionette:cancelRequest", cancelRequest);
   addMessageListenerId("Marionette:getCurrentUrl", getCurrentUrlFn);
   addMessageListenerId("Marionette:getTitle", getTitleFn);
   addMessageListenerId("Marionette:getPageSource", getPageSourceFn);
-  addMessageListenerId("Marionette:goBack", goBack);
+  addMessageListenerId("Marionette:goBack", goBackFn);
   addMessageListenerId("Marionette:goForward", goForward);
   addMessageListenerId("Marionette:refresh", refresh);
   addMessageListenerId("Marionette:findElementContent", findElementContent);
   addMessageListenerId("Marionette:findElementsContent", findElementsContent);
   addMessageListenerId("Marionette:getActiveElement", getActiveElementFn);
   addMessageListenerId("Marionette:clickElement", clickElementFn);
   addMessageListenerId("Marionette:getElementAttribute", getElementAttributeFn);
   addMessageListenerId("Marionette:getElementText", getElementTextFn);
@@ -313,17 +314,17 @@ function deleteSession(msg) {
   removeMessageListenerId("Marionette:actionChain", actionChain);
   removeMessageListenerId("Marionette:multiAction", multiAction);
   removeMessageListenerId("Marionette:get", get);
   removeMessageListenerId("Marionette:pollForReadyState", pollForReadyState);
   removeMessageListenerId("Marionette:cancelRequest", cancelRequest);
   removeMessageListenerId("Marionette:getTitle", getTitleFn);
   removeMessageListenerId("Marionette:getPageSource", getPageSourceFn);
   removeMessageListenerId("Marionette:getCurrentUrl", getCurrentUrlFn);
-  removeMessageListenerId("Marionette:goBack", goBack);
+  removeMessageListenerId("Marionette:goBack", goBackFn);
   removeMessageListenerId("Marionette:goForward", goForward);
   removeMessageListenerId("Marionette:refresh", refresh);
   removeMessageListenerId("Marionette:findElementContent", findElementContent);
   removeMessageListenerId("Marionette:findElementsContent", findElementsContent);
   removeMessageListenerId("Marionette:getActiveElement", getActiveElementFn);
   removeMessageListenerId("Marionette:clickElement", clickElementFn);
   removeMessageListenerId("Marionette:getElementAttribute", getElementAttributeFn);
   removeMessageListenerId("Marionette:getElementText", getElementTextFn);
@@ -1345,21 +1346,21 @@ function getTitle() {
  */
 function getPageSource() {
   let XMLSerializer = curFrame.XMLSerializer;
   let source = new XMLSerializer().serializeToString(curFrame.document);
   return source;
 }
 
 /**
- * Go back in history
+ * Cause the browser to traverse one step backward in the joint history
+ * of the current top-level browsing context.
  */
-function goBack(msg) {
+function goBack() {
   curFrame.history.back();
-  sendOk(msg.json.command_id);
 }
 
 /**
  * Go forward in history
  */
 function goForward(msg) {
   curFrame.history.forward();
   sendOk(msg.json.command_id);