<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
history.pushState("#1", "", "#1");
promise_test(async t => {
navigation.addEventListener("navigate", e => {
e.intercept();
}, { once: true });
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "after-transition" });
}, { once: true });
await navigation.back().finished;
}, "(not provided) + after-transition");
promise_test(async t => {
navigation.addEventListener("navigate", e => {
e.intercept();
}, { once: true });
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "manual" });
}, { once: true });
await navigation.forward().finished;
}, "(not provided) + manual");
promise_test(async t => {
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "after-transition" });
}, { once: true });
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "manual" });
}, { once: true });
await navigation.back().finished;
}, "after-transition + manual");
promise_test(async t => {
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "after-transition" });
}, { once: true });
navigation.addEventListener("navigate", e => {
e.intercept();
}, { once: true });
await navigation.forward().finished;
}, "after-transition + (not provided)");
promise_test(async t => {
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "manual" });
}, { once: true });
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "after-transition" });
}, { once: true });
await navigation.back().finished;
}, "manual + after-transition");
promise_test(async t => {
navigation.addEventListener("navigate", e => {
e.intercept({ scroll: "manual" });
}, { once: true });
navigation.addEventListener("navigate", e => {
e.intercept();
}, { once: true });
await navigation.forward().finished;
}, "manual + (not provided)");
</script>