Bug 1141519: error if we are going to try send a message to a frame that we know doesnt exist; r=jgriffin
authorDavid Burns <dburns@mozilla.com>
Wed, 16 Sep 2015 20:54:46 +0100
changeset 263597 6d92fc2898e9b9232d1642526a4f7eb25718fbae
parent 263596 b2c829ea4540ee6d6b7474325f1fb487995ef3fb
child 263598 88386ed1886c6e811b58690cf0adf3f4429d7857
push id65361
push userdburns@mozilla.com
push dateMon, 21 Sep 2015 20:10:41 +0000
treeherdermozilla-inbound@88386ed1886c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs1141519
milestone44.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/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -216,17 +216,22 @@ GeckoDriver.prototype.sendAsync = functi
   name = "Marionette:" + name;
 
   if (cmdId) {
     msg.command_id = cmdId;
   }
 
   if (curRemoteFrame === null) {
     this.curBrowser.executeWhenReady(() => {
-      this.mm.broadcastAsyncMessage(name + this.curBrowser.curFrameId, msg);
+      if (this.curBrowser.curFrameId) {
+          this.mm.broadcastAsyncMessage(name + this.curBrowser.curFrameId, msg);
+      }
+      else {
+          throw new WebDriverError("Can not send call to listener as it doesnt exist");
+      }
     });
   } else {
     let remoteFrameId = curRemoteFrame.targetFrameId;
     try {
       this.mm.sendAsyncMessage(name + remoteFrameId, msg);
     } catch (e) {
       switch(e.result) {
         case Components.results.NS_ERROR_FAILURE: