Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src=/resources/testdriver.js></script>
<script src=/resources/testdriver-vendor.js></script>
<script>
promise_test(async t => {
let w = window.open("/common/blank.html");
await new Promise(resolve => w.onload = resolve);

await test_driver.bless("navigate", async function() {
w.navigation.navigate(new URL("resources/navigate-during-onnavigate-should-reject-helper.html", location.href).href);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a relative URL

Suggested change
w.navigation.navigate(new URL("resources/navigate-during-onnavigate-should-reject-helper.html", location.href).href);
w.navigation.navigate("resources/navigate-during-onnavigate-should-reject-helper.html");

});

await new Promise(resolve => onmessage = resolve);
w.postMessage("start", "*");
await new Promise(resolve => onmessage = resolve);
w.close();
}, "Test that await navigation.back().finished during onnavigate should reject");
</script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LF at EOF please

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<head>
<script>
onload = () => {
opener.postMessage("load", "*");
};

onmessage = () => {
runTest();
}

async function runTest() {
await navigation.navigate("#1").finished;
navigation.onnavigate = async () => {
await navigation.back().finished.catch(() => {
opener.postMessage("done", "*");
})
}

history.back();
}
</script>
</head>