зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1526852 [wpt PR 15300] - Remove OriginalTimingAllowOrigin from ResourceTimingInfo, a=testonly
Automatic update from web-platform-tests Remove OriginalTimingAllowOrigin from ResourceTimingInfo The OriginalTimingAllowOrigin attribute was added in https://codereview.chromium.org/271083002 to ensure TAO headers are preserved on cached resources (304 responses). This CL removes it because it seems that it is no longer needed. It also moves the corresponding test to WPT. Bug: 929453 Change-Id: I41e0c84b04a94acc27c22e375f55398d9fc411e5 Reviewed-on: https://chromium-review.googlesource.com/c/1459333 Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by: Yoav Weiss <yoavweiss@chromium.org> Cr-Commit-Position: refs/heads/master@{#630441} -- wpt-commits: f84a067164651cc9069c36d6098d6a6b03d63816 wpt-pr: 15300
This commit is contained in:
Родитель
554479d85c
Коммит
89bcbeac72
|
@ -0,0 +1,25 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="resources/iframe-reload-TAO.sub.html"></iframe>
|
||||
<script>
|
||||
async_test(t => {
|
||||
window.onmessage = t.step_func(e => {
|
||||
const data = e.data;
|
||||
assert_greater_than(data.domainLookupStart, 0,
|
||||
"domainLookupStart should be greater than 0.");
|
||||
assert_greater_than(data.domainLookupEnd, 0,
|
||||
"domainLookupEnd should be greater than 0.");
|
||||
assert_greater_than(data.connectStart, 0,
|
||||
"connectStart should be greater than 0.");
|
||||
assert_greater_than(data.connectEnd, 0,
|
||||
"connectEnd should be greater than 0.");
|
||||
t.done();
|
||||
});
|
||||
}, "Test that TAO headers are reused on reloads.");
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,17 @@
|
|||
import os.path
|
||||
|
||||
def main(request, response):
|
||||
etag = "123abc"
|
||||
if etag == request.headers.get("If-None-Match", None):
|
||||
response.headers.set("X-HTTP-STATUS", 304)
|
||||
response.status = (304, "Not Modified")
|
||||
return ""
|
||||
|
||||
response.headers.set("Cache-Control", "public, max-age=86400")
|
||||
response.headers.set("Content-Type", "font/truetype")
|
||||
response.headers.set("Access-Control-Allow-Origin", "*")
|
||||
response.headers.set("Timing-Allow-Origin", "*")
|
||||
response.headers.set("ETag", etag)
|
||||
font = "../../fonts/Ahem.ttf"
|
||||
path = os.path.join(os.path.dirname(__file__), font)
|
||||
response.content = open(path, "rb").read()
|
|
@ -0,0 +1,28 @@
|
|||
<style>
|
||||
@font-face {
|
||||
font-family: ahem;
|
||||
src: url(http://{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/cors-ahem.py);
|
||||
}
|
||||
</style>
|
||||
<div style="font-family: ahem;">This fetches ahem font.</div>
|
||||
<script>
|
||||
if (location.hash === '#check') {
|
||||
document.fonts.ready.then(()=> {
|
||||
const entries = performance.getEntriesByName('http://{{domains[www]}}:{{ports[http][1]}}/resource-timing/resources/cors-ahem.py');
|
||||
if (entries.length != 1)
|
||||
return;
|
||||
const entry = entries[0];
|
||||
window.parent.postMessage({
|
||||
"domainLookupStart": entry.domainLookupStart,
|
||||
"domainLookupEnd": entry.domainLookupEnd,
|
||||
"connectStart": entry.connectStart,
|
||||
"connectEnd": entry.connectEnd
|
||||
}, "*");
|
||||
});
|
||||
} else {
|
||||
document.fonts.ready.then(() => {
|
||||
location.hash = 'check';
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
</script>
|
Загрузка…
Ссылка в новой задаче