Update web-platform-tests to revision d7afcb8708eac08a614d161d5622a48172daf7e3

This commit is contained in:
WPT Sync Bot 2019-05-15 10:40:54 -04:00 committed by Josh Matthews
parent 6f8bb4dd40
commit edff458e23
791 changed files with 17647 additions and 10322 deletions

View file

@ -1,17 +1,33 @@
<!DOCTYPE html>
<title>Makes sure that Link headers preload resources with CSP nonce</title>
<script nonce="abc" src="/resources/testharness.js"></script>
<script nonce="abc" src="/resources/testharnessreport.js"></script>
<script nonce="abc" src="/preload/resources/preload_helper.js"></script>
<body>
<script nonce="abc">
var t = async_test('Makes sure that Link headers preload resources with CSP nonce');
</script>
<script nonce="abc">
window.addEventListener('load', t.step_func(function() {
t.step_timeout(function() {
verifyPreloadAndRTSupport();
verifyNumberOfResourceTimingEntries("resources/dummy.js?from-header&without-nonce", 0);
verifyNumberOfResourceTimingEntries("resources/dummy.js?from-header&with-nonce", 1);
t.done();
}, 5000);
}));
setup({explicit_done: true});
var iterations = 0;
function check_finished() {
if (numberOfResourceTimingEntries("resources/dummy.js?from-header&without-nonce") == 0 &&
numberOfResourceTimingEntries("resources/dummy.js?from-header&with-nonce") == 1) {
done();
}
iterations++;
if (iterations == 10) {
// At least one is expected to fail, but this should give details to the exact failure(s).
verifyNumberOfResourceTimingEntries("resources/dummy.js?from-header&without-nonce", 0);
verifyNumberOfResourceTimingEntries("resources/dummy.js?from-header&with-nonce", 1);
done();
} else {
step_timeout(check_finished, 500);
}
}
window.addEventListener("load", function() {
verifyPreloadAndRTSupport();
step_timeout(check_finished, 0);
});
</script>
</body>