Update web-platform-tests to revision 8ae1ddbc812733c3a73b103eafad56fb43a2f4b5

This commit is contained in:
WPT Sync Bot 2019-01-26 20:37:16 -05:00
parent d44e9aced2
commit 0e5e5db397
109 changed files with 2053 additions and 708 deletions

View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<!---
Tentative test against:
https://github.com/whatwg/fetch/pull/853
-->
<meta charset="utf-8">
<title>Tests Stale While Revalidate works for css</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
async_test(t => {
window.onload = t.step_func(() => {
step_timeout(() => {
assert_equals(window.getComputedStyle(document.body).getPropertyValue('background-color'), "rgb(0, 128, 0)");
var link2 = document.createElement("link");
link2.onload = t.step_func(() => {
assert_equals(window.getComputedStyle(document.body).getPropertyValue('background-color'), "rgb(0, 128, 0)");
var checkResult = () => {
// We poll because we don't know when the revalidation will occur.
fetch("stale-css.py?query").then(t.step_func((response) => {
var count = response.headers.get("Count");
if (count == '2') {
t.done();
} else {
t.step_timeout(checkResult, 25);
}
}));
};
t.step_timeout(checkResult, 25);
});
link2.rel = "stylesheet";
link2.type = "text/css";
link2.href = "stale-css.py";
document.body.appendChild(link2);
}, 0);
});
}, 'Cache returns stale resource');
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = "stale-css.py";
document.body.appendChild(link);
</script>
</body>