From 93fe1c72cb40482826e053c914fd8791fb5e71b9 Mon Sep 17 00:00:00 2001 From: Jonathan Griffin Date: Mon, 12 Nov 2012 16:17:54 -0800 Subject: [PATCH] Bug 810517 - Check for valid listenerWindow, r=mdas --- testing/marionette/marionette-actors.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/testing/marionette/marionette-actors.js b/testing/marionette/marionette-actors.js index d3444cfdbb2..51cfc0fa9aa 100644 --- a/testing/marionette/marionette-actors.js +++ b/testing/marionette/marionette-actors.js @@ -1655,13 +1655,15 @@ MarionetteDriverActor.prototype = { .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();