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 8f15c6137e4f ☠ ☠
authorDavid Burns <dburns@mozilla.com>
Wed, 16 Sep 2015 20:54:46 +0100
changeset 295892 2c319ee6609b45f254194005991218a8e6f1b1ce
parent 295891 2101909374c09e8b06af50cedfc59ccccf078d0e
child 295893 4f0cd3e94c0a34500c60951e3e80bcd312167fe5
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs1141519
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 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: