Bug 810517 - Check for valid listenerWindow, r=mdas
authorJonathan Griffin <jgriffin@mozilla.com>
Mon, 12 Nov 2012 16:17:54 -0800
changeset 113060 76509d0847ecdc30ccf1cbc9b8cabe8866a1efbb
parent 113059 cab9c764a898e00de2c7242ccafe537d41b49f5b
child 113061 24babe39cd7e49b531f003478eab98f9e29060bc
push id23848
push useremorley@mozilla.com
push dateTue, 13 Nov 2012 16:29:34 +0000
treeherdermozilla-central@d56d537a1843 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmdas
bugs810517
milestone19.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 810517 - Check for valid listenerWindow, r=mdas
testing/marionette/marionette-actors.js
--- a/testing/marionette/marionette-actors.js
+++ b/testing/marionette/marionette-actors.js
@@ -1650,23 +1650,25 @@ MarionetteDriverActor.prototype = {
         // This code processes the content listener's registration information
         // and either accepts the listener, or ignores it
         let nullPrevious = (this.curBrowser.curFrameId == null);
         let curWin = this.getCurrentWindow();
         let listenerWindow = curWin.QueryInterface(Ci.nsIInterfaceRequestor)
                                    .getInterface(Ci.nsIDOMWindowUtils)
                                    .getOuterWindowWithId(message.json.value);
 
-        if ((listenerWindow.location.href != message.json.href) &&
+        if (!listenerWindow || (listenerWindow.location.href != message.json.href) &&
             (this.currentRemoteFrame !== null)) {
-          // If there is a mismatch between the calculated href and the one
-          // sent from the frame script, it means that the frame script is
-          // running in a separate process.  Currently this only happens
+          // The outerWindowID from an OOP frame will not be meaningful to
+          // the parent process here, since each process maintains its own
+          // independent window list.  So, it will either be null (!listenerWindow)
+          // or it will point to some random window, which will hopefully 
+          // cause an href mistmach.  Currently this only happens
           // in B2G for OOP frames registered in Marionette:switchToFrame, so
-          //  we'll acknowledge the switchToFrame message here.
+          // we'll acknowledge the switchToFrame message here.
           // XXX: Should have a better way of determining that this message
           // is from a remote frame.
           this.sendOk();
           this.currentRemoteFrame.targetFrameId = this.generateFrameId(message.json.value);
         }
 
         let browserType;
         try {