1
0
Fork 0
firefox/testing/web-platform/tests/navigation-api/navigation-methods/navigate-state-repeated.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

20 lines
749 B
HTML

<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
navigation.onnavigate = e => e.intercept();
let result1 = navigation.navigate('/foo', {state: {foo: 1}});
assert_equals(navigation.currentEntry.getState().foo, 1);
// Don't let the harness fail because of the "AbortError" DOMException that is caused by interrupting the navigation.
result1.finished.catch(() => {});
let result2 = navigation.navigate('/foo', {state: {foo: 2}});
assert_equals(navigation.currentEntry.getState().foo, 2);
await result1.committed;
await result2.committed;
}, "navigate() with state should work correctly when called repeatedly");
</script>