Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /navigation-api/navigation-methods/navigate-info-and-state.html - WPT Dashboard Interop Dashboard
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
promise_test(async t => {
let navInfo = { nav : "info" };
let navState = { statevar: "state" };
let onnavigated_called = false;
navigation.onnavigate = t.step_func(e => {
onnavigated_called = true;
assert_equals(e.info, navInfo)
});
await navigation.navigate("#1", { info: navInfo, state: navState }).committed;
assert_true(onnavigated_called);
assert_not_equals(navigation.currentEntry.getState(), navState);
assert_equals(navigation.currentEntry.getState().statevar, navState.statevar);
}, "navigate() with info and state");
</script>