From 1decae6fee4aa0c756460fb0d575079f40c6bc3e Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 16 May 2017 18:56:34 -0700 Subject: [PATCH] Bug 1375710 - Remove CPOWs from browser_tabfocus.js. r=Gijs This test was already trying to prevent itself from touching CPOWs. The trick is to stop the event from ever propagating all the way to the shim. MozReview-Commit-ID: 4oVt7x3J6eI --HG-- extra : rebase_source : 1d16c6270e24712bf4c4861c0deb5a587342918a --- browser/base/content/test/general/browser_tabfocus.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/browser/base/content/test/general/browser_tabfocus.js b/browser/base/content/test/general/browser_tabfocus.js index 79fa7a359586..41c9fb8cd382 100644 --- a/browser/base/content/test/general/browser_tabfocus.js +++ b/browser/base/content/test/general/browser_tabfocus.js @@ -71,6 +71,9 @@ function focusInChild() { } function eventListener(event) { + // Stop the shim code from seeing this event process. + event.stopImmediatePropagation(); + var id; if (event.target instanceof Components.interfaces.nsIDOMWindow) id = getWindowDocId(event.originalTarget) + "-window"; @@ -136,7 +139,7 @@ add_task(async function() { await promiseTabLoadEvent(tab1, "data:text/html," + escape(testPage1)); await promiseTabLoadEvent(tab2, "data:text/html," + escape(testPage2)); - var childFocusScript = "data:,(" + focusInChild.toString() + ")();"; + var childFocusScript = "data:,(" + escape(focusInChild.toString()) + ")();"; browser1.messageManager.loadFrameScript(childFocusScript, true); browser2.messageManager.loadFrameScript(childFocusScript, true); @@ -380,10 +383,6 @@ function _browser_tabfocus_test_eventOccured(event) { var id; - // Some focus events from the child bubble up? Ignore them. - if (Cu.isCrossProcessWrapper(event.originalTarget)) - return; - if (event.target instanceof Window) id = getWindowDocId(event.originalTarget) + "-window"; else if (event.target instanceof Document)