Bug 1141519: error if we are going to try send a message to a frame that we know doesnt exist; r=jgriffin
☠☠ backed out by a21d6a26ae50 ☠ ☠
authorDavid Burns <dburns@mozilla.com>
Thu, 19 Mar 2015 00:02:47 +0000
changeset 265372 85c4ceb3c650cdae07e7ecac655470b88ec69004
parent 265371 78a27ab48c548377e46bdc1b3ed1df92267133dc
child 265373 72c48d6ddc0bd616d7f6105858e99ca9752363c8
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs1141519
milestone39.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 1141519: error if we are going to try send a message to a frame that we know doesnt exist; r=jgriffin
testing/marionette/marionette-server.js
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -291,18 +291,23 @@ MarionetteServerConnection.prototype = {
           }
           let code = error.hasOwnProperty('code') ? e.code : 500;
           this.sendError(error.toString(), code, error.stack, commandId);
         }
       }
     }
     else {
       this.curBrowser.executeWhenReady(() => {
-        this.messageManager.broadcastAsyncMessage(
-          "Marionette:" + name + this.curBrowser.curFrameId, values);
+        if (this.curBrowser.curFrameId) {
+          this.messageManager.broadcastAsyncMessage(
+            "Marionette:" + name + this.curBrowser.curFrameId, values);
+        }
+        else {
+          this.sendError("Can not send call to listener as it does not exist", 500, null, commandId);
+        }
       });
     }
     return success;
   },
 
   logRequest: function MDA_logRequest(type, data) {
     logger.debug("Got request: " + type + ", data: " + JSON.stringify(data) + ", id: " + this.command_id);
   },