-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[resource timing] Improve document.domain tests (reland)
This CL is a fixed up reland of [1], which was reverted due to a rename in entry-invariants.js that it was relying on. [1] https://chromium-review.googlesource.com/c/chromium/src/+/2878852 Bug: 1171767 Change-Id: I436bf6973e4399d142ce45e77c07f26d0e7e1cd1
- Loading branch information
1 parent
95eeb24
commit e6a2f4c
Showing
7 changed files
with
66 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/get-host-info.sub.js"></script> | ||
<script> | ||
// Open a document on one of hosts on the web-platform test domain, so that | ||
// document.domain will set a valid domain, turning the frame into a | ||
// cross-origin frame. | ||
const {OTHER_ORIGIN} = get_host_info(); | ||
const openee = window.open(OTHER_ORIGIN + | ||
"/resource-timing/resources/document-domain-no-impact.html"); | ||
fetch_tests_from_window(openee); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="resource-loaders.js"></script> | ||
<script src="entry-invariants.js"></script> | ||
<body> | ||
<script> | ||
const path = location.origin + | ||
"/resource-timing/resources/iframe-setdomain.sub.html"; | ||
attribute_test_with_validator(load.iframe, path, | ||
el => { | ||
try { | ||
el.contentWindow.document; | ||
throw new Error("iframe document.domain was not set"); | ||
} catch(error) { | ||
if (error.name != "SecurityError") { | ||
throw(error); | ||
} | ||
} | ||
}, | ||
invariants.assert_tao_pass_no_redirect, | ||
"test that document.domain being set doesn't have an impact on the " + | ||
"resource timing entry." | ||
); | ||
</script> | ||
|
33 changes: 0 additions & 33 deletions
33
resource-timing/resources/document-domain-no-impact.sub.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters