Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8" />
<title>Resource Timing TAO - "null" and opaque origin</title>
<link rel="author" title="Google" href="" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<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.
<iframe id="frameContext"></iframe>
const {ORIGIN} = get_host_info();
const url = `${ORIGIN}/resource-timing/resources/`;
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>
attribute_test(fetch, "${url}?tao=null",
"An opaque origin should be authorized to see resource timings when the" +
"TAO header is the string 'null'");
attribute_test(fetch, "${url}?tao=Null",
"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 " +
</` + `script>
</body>`; = "display:none";
frameContext.src = frame_content;