diff --git a/testing/specialpowers/content/SpecialPowersChild.jsm b/testing/specialpowers/content/SpecialPowersChild.jsm index 45a9ae8fed71..280cb00032eb 100644 --- a/testing/specialpowers/content/SpecialPowersChild.jsm +++ b/testing/specialpowers/content/SpecialPowersChild.jsm @@ -2245,12 +2245,18 @@ class SpecialPowersChild extends JSWindowActorChild { * we need to wait for the updated data. */ contentTransformsReceived(win) { - try { - // throw if win is not a remote browser. - return win.docShell.browserChild.contentTransformsReceived(); - } catch (e) { - return Promise.resolve(); + while (win) { + try { + return win.docShell.browserChild.contentTransformsReceived(); + } catch (ex) { + // browserChild getter throws on non-e10s rather than returning null. + } + if (win == win.parent) { + break; + } + win = win.parent; } + return Promise.resolve(); } } diff --git a/toolkit/content/tests/browser/head.js b/toolkit/content/tests/browser/head.js index 4667b7cfc1d9..6531aae023a0 100644 --- a/toolkit/content/tests/browser/head.js +++ b/toolkit/content/tests/browser/head.js @@ -200,6 +200,11 @@ class DateTimeTestHelper { }); bc = bc.browsingContext.children[0]; } + await SpecialPowers.spawn(bc, [], async function() { + // Ensure that screen coordinates are ok. + await SpecialPowers.contentTransformsReceived(content); + }); + if (openMethod === "click") { await BrowserTestUtils.synthesizeMouseAtCenter("input", {}, bc); } else if (openMethod === "showPicker") {