Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!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>