diff options
Diffstat (limited to '')
-rw-r--r-- | testing/web-platform/tests/navigation-api/navigation-methods/navigate-info-and-state.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/navigation-api/navigation-methods/navigate-info-and-state.html b/testing/web-platform/tests/navigation-api/navigation-methods/navigate-info-and-state.html new file mode 100644 index 0000000000..828d7daea5 --- /dev/null +++ b/testing/web-platform/tests/navigation-api/navigation-methods/navigate-info-and-state.html @@ -0,0 +1,18 @@ +<!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> |