tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 5980df272ec0cb9026ceb173b38597272688a463
parent 8404b8b49b0f90bb552ee8f7d3ffe56f6d7abf4a
Author: Vincent Hilla <vhilla@mozilla.com>
Date:   Mon,  1 Dec 2025 17:25:54 +0000

Bug 2002313 - Continue to fail tests for bug 1429507 silently if window.open fails. r=webrtc-reviewers,dom-core,smaug,pehrsons

Bug 543435 changed when window reuse occured and made the initial about:blank
load sync.
This required changing the loaded URL of the tests for bug 1429507 to non-blank
URLs. I added code to verify the window is reused, but aparently window.open
can fail in reftests in certain configurations, already before bug 543435.

Differential Revision: https://phabricator.services.mozilla.com/D274437

Diffstat:
Mdom/media/tests/crashtests/1429507_1.html | 10++++------
Mdom/media/tests/crashtests/1429507_2.html | 10++++------
2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dom/media/tests/crashtests/1429507_1.html b/dom/media/tests/crashtests/1429507_1.html @@ -4,9 +4,11 @@ let o1; let p1, p2; window.addEventListener("MozReftestInvalidate", finish); + // Synchronously call reload while an async load away from the initial about:blank is ongoing. + // This causes the window to be reused and a navigation event to mess with the gUM request. try { o1 = window.open("/") } catch (e) {} - o1.foo = 1 - // We require inner window reuse, so reload while an async load is ongoing + // Note: window.open can fail here in some configurations, so o1 might be null. + // But the try/catch silence that (bug 2002313). try { o1.location.reload() } catch (e) {} try { o2 = new RTCPeerConnection({iceServers: [{"url": "stun:d"}]}) } catch (e) {} try { p1 = o1.navigator.mediaDevices.getUserMedia({video: true, fake: true}).catch((error) => {}) } catch (e) {} @@ -21,10 +23,6 @@ try { await p2; } catch (e) {} - if (o1.foo != 1) { - // fail if no window reuse - return; - } try { o1.close(); } catch (e) {} diff --git a/dom/media/tests/crashtests/1429507_2.html b/dom/media/tests/crashtests/1429507_2.html @@ -4,9 +4,11 @@ let o1; let p1, p2; window.addEventListener("MozReftestInvalidate", finish); + // Synchronously call reload while an async load away from the initial about:blank is ongoing. + // This causes the window to be reused and a navigation event to mess with the gUM request. try { o1 = window.open("/") } catch(e) { } - o1.foo = 1 - // We require inner window reuse, so reload while an async load is ongoing + // Note: window.open can fail here in some configurations, so o1 might be null. + // But the try/catch silence that (bug 2002313). try { o1.location.reload() } catch(e) { } try { o2 = o1.navigator } catch(e) { } try { o3 = o2.mediaDevices } catch(e) { } @@ -23,10 +25,6 @@ try { await p2; } catch (e) {} - if (o1.foo != 1) { - // fail if no window reuse - return; - } try { o1.close(); } catch (e) {}