commit 0e11c81a230aefea81effc2c398ac7c9defd178a
parent 8676ef3c063028a287b83621d0e5e1392afe6cd3
Author: Andreas Farre <farre@mozilla.com>
Date: Sat, 22 Nov 2025 21:10:56 +0000
Bug 1991265 [wpt PR 55399] - [Gecko Bug 1991265] Make push to replace load conversion follow spec., a=testonly
Automatic update from web-platform-tests
Make push to replace load conversion follow spec.
Make sure that navigations from Location and Window.open perform correct
conversion of history handling when passed "auto".
Differential Revision: https://phabricator.services.mozilla.com/D266519
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1991265
gecko-commit: e67638d359bee3a190610f4c644281c67c691bcb
gecko-reviewers: smaug, webdriver-reviewers
--
Await onload to work around bug in Blink.
Navigating while loading should result in a replace load, but to not
get this test excluded from interop we make sure to wait for onload
before running the restor of the test and making asserts.
--
wpt-commits: a20ada84bf3fcc51ddab4acc13dc292a8992a52c, e5849dc518a806a5ac75dd6ad42b2c7be6538de7
wpt-pr: 55399
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-navigate.html b/testing/web-platform/tests/navigation-api/navigate-event/navigate-navigation-navigate.html
@@ -2,7 +2,10 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
-async_test(t => {
+promise_test(async t => {
+ await new Promise(resolve => addEventListener('load', () => t.step_timeout(resolve, 0), {once: true}));
+
+ let { promise, resolve } = Promise.withResolvers();
navigation.onnavigate = t.step_func_done(e => {
assert_equals(e.navigationType, "push");
assert_true(e.cancelable);
@@ -17,7 +20,9 @@ async_test(t => {
assert_equals(e.destination.index, -1);
assert_equals(e.formData, null);
assert_equals(e.sourceElement, null);
+ resolve();
});
navigation.navigate("#foo");
+ await promise;
}, "navigate event for navigation.navigate()");
</script>