-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResourceTiming]: Update WPTs concerning opaque origins
Both TAO-null-opaque-origin.html and TAO-case-insensitive-null-opaque-origin.sub.html test the Resource Timing API when resources are fetched from an opaque origin context. This change updates those tests to conform to wpt/resource-timing/CodingConventions.md. Bug: 1171767 Change-Id: I3bfbaa4a714a4582a5c900aa345df118828e1e0e GithubIssue: w3c/resource-timing#254 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3042198 Commit-Queue: Tom McKee <[email protected]> Reviewed-by: Yoav Weiss <[email protected]> Cr-Commit-Position: refs/heads/master@{#905292}
- Loading branch information
1 parent
3572a38
commit 39fb1e2
Showing
3 changed files
with
46 additions
and
97 deletions.
There are no files selected for viewing
42 changes: 0 additions & 42 deletions
42
resource-timing/TAO-case-insensitive-null-opaque-origin.sub.html
This file was deleted.
Oops, something went wrong.
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,46 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Resource Timing TAO - "null" and opaque origin</title> | ||
<link rel="author" title="Google" href="http://www.google.com/" /> | ||
<link rel="help" href="https://www.w3.org/TR/resource-timing-2/#timing-allow-origin"/> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/get-host-info.sub.js"></script> | ||
</head> | ||
<body> | ||
<h1>Description</h1> | ||
<p>This test validates that, for a cross origin resource, the timing allow | ||
check algorithm will correctly distinguish between 'null' and 'Null' values in | ||
the Timing-Allow-Origin header. An opaque origin's serialization is the string | ||
"null" and the timing allow origin check needs to do a case-sensitive comparison | ||
to the Timing-Allow-Origin header. | ||
</p> | ||
<iframe id="frameContext"></iframe> | ||
<script> | ||
const {ORIGIN} = get_host_info(); | ||
const url = `${ORIGIN}/resource-timing/resources/TAOResponse.py`; | ||
const frame_content = `data:text/html;utf8,<body> | ||
<script src="${ORIGIN}/resources/testharness.js"></` + `script> | ||
<script src="${ORIGIN}/resource-timing/resources/entry-invariants.js"> | ||
</` + `script> | ||
<script> | ||
attribute_test(fetch, "${url}?tao=null", | ||
invariants.assert_tao_pass_no_redirect_http, | ||
"An opaque origin should be authorized to see resource timings when the" + | ||
"TAO header is the string 'null'"); | ||
attribute_test(fetch, "${url}?tao=Null", | ||
invariants.assert_tao_failure_resource, | ||
"An opaque origin must not be authorized to see resource timings when " + | ||
"the TAO header is the string 'Null'. (The check for 'null' must be " + | ||
"case-sensitive)"); | ||
</` + `script> | ||
</body>`; | ||
|
||
frameContext.style = "display:none"; | ||
frameContext.src = frame_content; | ||
fetch_tests_from_window(frameContext.contentWindow); | ||
</script> | ||
</body> | ||
</html> |