Skip to content

Commit

Permalink
s/reload/navigate/
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavweiss committed Nov 6, 2018
1 parent 010d357 commit 5bf797d
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing embed reload - back button navigation</title>
<title>Resource Timing embed navigate - back button navigation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let t = async_test("Test that embed reloads are not observable by the parent, even after history navigations");
window.open("resources/embed-reload-back.html");
let t = async_test("Test that embed navigates are not observable by the parent, even after history navigations");
window.open("resources/embed-navigate-back.html");
addEventListener("message", t.step_func(e => {
assert_equals(e.data, "PASS");
t.done();
Expand Down
33 changes: 33 additions & 0 deletions resource-timing/embed-navigate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing embed navigate</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let t = async_test("Test that HTML embed navigates are not observable by the parent");
const pre_navigate_url = new URL("resources/document-that-navigates.html", location).href;
const post_navigate_url = new URL("resources/document-navigated.html", location).href;
function verify_embed_navigate_not_observable() {
let entries = performance.getEntriesByType("resource");
let found_first_embed = false;
for (entry of entries) {
if (entry.name == pre_navigate_url) {
found_first_embed = true;
}
assert_not_equals(entry.name, post_navigate_url, "Navigated embed should not be observable");
}
assert_true(found_first_embed, "Initial embed should be observable");
t.done();
}
window.addEventListener("message", t.step_func(e=>{
if (e.data == "navigated") {
verify_embed_navigate_not_observable();
}
}));
</script>
<embed type="text/html">
<script>
document.getElementsByTagName("embed")[0].src = pre_navigate_url;
</script>
33 changes: 0 additions & 33 deletions resource-timing/embed-reload.html

This file was deleted.

6 changes: 3 additions & 3 deletions resource-timing/iframe-reload-back.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing iframe reload - back button navigation</title>
<title>Resource Timing iframe navigate - back button navigation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let t = async_test("Test that iframe reloads are not observable by the parent, even after history navigations");
window.open("resources/iframe-reload-back.html");
let t = async_test("Test that iframe navigates are not observable by the parent, even after history navigations");
window.open("resources/iframe-navigate-back.html");
addEventListener("message", t.step_func(e => {
assert_equals(e.data, "PASS");
t.done();
Expand Down
20 changes: 10 additions & 10 deletions resource-timing/iframe-reload.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing iframe reload</title>
<title>Resource Timing iframe navigate</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let t = async_test("Test that iframe reloads are not observable by the parent");
const pre_reload_url = new URL("resources/document-that-reloads.html", location).href;
const post_reload_url = new URL("resources/document-reloaded.html", location).href;
function verify_iframe_reload_not_observable() {
let t = async_test("Test that iframe navigates are not observable by the parent");
const pre_navigate_url = new URL("resources/document-that-navigates.html", location).href;
const post_navigate_url = new URL("resources/document-navigated.html", location).href;
function verify_iframe_navigate_not_observable() {
let entries = performance.getEntriesByType("resource");
let found_first_iframe = false;
for (entry of entries) {
if (entry.name == pre_reload_url) {
if (entry.name == pre_navigate_url) {
found_first_iframe = true;
}
assert_not_equals(entry.name, post_reload_url, "Reloaded iframe should not be observable.");
assert_not_equals(entry.name, post_navigate_url, "Navigated iframe should not be observable.");
}
assert_true(found_first_iframe, "Initial iframe should be observable");
t.done();
}
window.addEventListener("message", t.step_func(e=>{
if (e.data == "reloaded") {
verify_iframe_reload_not_observable();
if (e.data == "navigated") {
verify_iframe_navigate_not_observable();
}
}));
</script>
<iframe></iframe>
<script>
document.getElementsByTagName("iframe")[0].src = pre_reload_url;
document.getElementsByTagName("iframe")[0].src = pre_navigate_url;
</script>
6 changes: 3 additions & 3 deletions resource-timing/object-reload-back.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing object reload - back button navigation</title>
<title>Resource Timing object navigate - back button navigation</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let t = async_test("Test that object reloads are not observable by the parent, even after history navigations");
window.open("resources/object-reload-back.html");
let t = async_test("Test that object navigates are not observable by the parent, even after history navigations");
window.open("resources/object-navigate-back.html");
addEventListener("message", t.step_func(e => {
assert_equals(e.data, "PASS");
t.done();
Expand Down
20 changes: 10 additions & 10 deletions resource-timing/object-reload.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing object reload</title>
<title>Resource Timing object navigate</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
let t = async_test("Test that object reloads are not observable by the parent");
const pre_reload_url = new URL("resources/document-that-reloads.html", location).href;
const post_reload_url = new URL("resources/document-reloaded.html", location).href;
function verify_object_reload_not_observable() {
let t = async_test("Test that object navigates are not observable by the parent");
const pre_navigate_url = new URL("resources/document-that-navigates.html", location).href;
const post_navigate_url = new URL("resources/document-navigated.html", location).href;
function verify_object_navigate_not_observable() {
let entries = performance.getEntriesByType("resource");
let found_first_object = false;
for (entry of entries) {
if (entry.name == pre_reload_url) {
if (entry.name == pre_navigate_url) {
found_first_object = true;
}
assert_not_equals(entry.name, post_reload_url, "Reloaded object should not be observable");
assert_not_equals(entry.name, post_navigate_url, "Navigated object should not be observable");
}
assert_true(found_first_object, "Initial object should be observable");
t.done();
}
window.addEventListener("message", t.step_func(e=>{
if (e.data == "reloaded") {
verify_object_reload_not_observable();
if (e.data == "navigated") {
verify_object_navigate_not_observable();
}
}));
</script>
<object></object>
<script>
document.getElementsByTagName("object")[0].data = pre_reload_url;
document.getElementsByTagName("object")[0].data = pre_navigate_url;
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<meta charset="utf-8" />
</head>
<body>
Reloaded document!
navigated document!
<script>
top.postMessage("reloaded", "*");
top.postMessage("navigated", "*");
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<script>
location.href="document-reloaded.html";
location.href="document-navigated.html";
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing embed reload - back button navigation</title>
<title>Resource Timing embed navigate - back button navigation</title>
<script>
const pre_reload_url = new URL("document-that-reloads.html", location).href;
const post_reload_url = new URL("document-reloaded.html", location).href;
function verify_embed_reload_not_observable() {
const pre_navigate_url = new URL("document-that-navigates.html", location).href;
const post_navigate_url = new URL("document-navigated.html", location).href;
function verify_embed_navigate_not_observable() {
let entries = performance.getEntriesByType("resource");
let found_first_embed = false;
for (entry of entries) {
if (entry.name == pre_reload_url) {
if (entry.name == pre_navigate_url) {
found_first_embed = true;
}
if (entry.name == post_reload_url) {
opener.postMessage("FAIL - reloaded embed exposed", "*");
if (entry.name == post_navigate_url) {
opener.postMessage("FAIL - navigated embed exposed", "*");
return;
}
}
Expand All @@ -25,14 +25,14 @@
opener.postMessage("PASS", "*");
}
window.addEventListener("message", e=>{
if (e.data == "reloaded") {
if (e.data == "navigated") {
if (sessionStorage.navigated) {
delete sessionStorage.navigated;
verify_embed_reload_not_observable();
verify_embed_navigate_not_observable();
} else {
sessionStorage.navigated = true;
setTimeout(() => {
history.pushState({}, "", "embed-reload-back.html");
history.pushState({}, "", "embed-navigate-back.html");
location.href="navigate_back.html";
}, 0);
}
Expand All @@ -41,5 +41,5 @@
</script>
<embed type="text/html">
<script>
document.getElementsByTagName("embed")[0].src = pre_reload_url;
document.getElementsByTagName("embed")[0].src = pre_navigate_url;
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing iframe reload - back button navigation</title>
<title>Resource Timing iframe navigate - back button navigation</title>
<script>
const pre_reload_url = new URL("document-that-reloads.html", location).href;
const post_reload_url = new URL("document-reloaded.html", location).href;
function verify_iframe_reload_not_observable() {
const pre_navigate_url = new URL("document-that-navigates.html", location).href;
const post_navigate_url = new URL("document-navigated.html", location).href;
function verify_iframe_navigate_not_observable() {
let entries = performance.getEntriesByType("resource");
let found_first_iframe = false;
for (entry of entries) {
if (entry.name == pre_reload_url) {
if (entry.name == pre_navigate_url) {
found_first_iframe = true;
}
if (entry.name == post_reload_url) {
opener.postMessage("FAIL - reloaded iframe exposed", "*");
if (entry.name == post_navigate_url) {
opener.postMessage("FAIL - navigated iframe exposed", "*");
return;
}
}
Expand All @@ -25,14 +25,14 @@
opener.postMessage("PASS", "*");
}
window.addEventListener("message", e=>{
if (e.data == "reloaded") {
if (e.data == "navigated") {
if (sessionStorage.navigated) {
delete sessionStorage.navigated;
verify_iframe_reload_not_observable();
verify_iframe_navigate_not_observable();
} else {
sessionStorage.navigated = true;
setTimeout(() => {
history.pushState({}, "", "iframe-reload-back.html");
history.pushState({}, "", "iframe-navigate-back.html");
location.href="navigate_back.html";
}, 0);
}
Expand All @@ -41,5 +41,5 @@
</script>
<iframe></iframe>
<script>
document.getElementsByTagName("iframe")[0].src = pre_reload_url;
document.getElementsByTagName("iframe")[0].src = pre_navigate_url;
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
<html>
<head>
<meta charset="utf-8" />
<title>Resource Timing object reload - back button navigation</title>
<title>Resource Timing object navigate - back button navigation</title>
<script>
const pre_reload_url = new URL("document-that-reloads.html", location).href;
const post_reload_url = new URL("document-reloaded.html", location).href;
function verify_iframe_reload_not_observable() {
const pre_navigate_url = new URL("document-that-navigates.html", location).href;
const post_navigate_url = new URL("document-navigated.html", location).href;
function verify_iframe_navigate_not_observable() {
let entries = performance.getEntriesByType("resource");
let found_first_iframe = false;
for (entry of entries) {
if (entry.name == pre_reload_url) {
if (entry.name == pre_navigate_url) {
found_first_iframe = true;
}
if (entry.name == post_reload_url) {
opener.postMessage("FAIL - reloaded iframe exposed", "*");
if (entry.name == post_navigate_url) {
opener.postMessage("FAIL - navigated iframe exposed", "*");
return;
}
}
Expand All @@ -25,14 +25,14 @@
opener.postMessage("PASS", "*");
}
window.addEventListener("message", e=>{
if (e.data == "reloaded") {
if (e.data == "navigated") {
if (sessionStorage.navigated) {
delete sessionStorage.navigated;
verify_iframe_reload_not_observable();
verify_iframe_navigate_not_observable();
} else {
sessionStorage.navigated = true;
setTimeout(() => {
history.pushState({}, "", "object-reload-back.html");
history.pushState({}, "", "object-navigate-back.html");
location.href="navigate_back.html";
}, 0);
}
Expand All @@ -41,5 +41,5 @@
</script>
<object></object>
<script>
document.getElementsByTagName("object")[0].data = pre_reload_url;
document.getElementsByTagName("object")[0].data = pre_navigate_url;
</script>

0 comments on commit 5bf797d

Please sign in to comment.