blob: b424b54f0ad150bc7ebd3ecd1852aa8682763606 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
const t = async_test("Ensure preloads use video poster crossorigin value");
window.addEventListener('load', t.step_func_done(function() {
let entries = performance.getEntriesByName("http://localhost:8080/security/resources/image-access-control.php?file=../../resources/square100.png&allow=false");
assert_equals(entries.length, 1, "100.png should get an entry");
assert_equals(entries[0].nextHopProtocol, '', "100.png should not be loaded");
entries = performance.getEntriesByName("http://localhost:8080/security/resources/image-access-control.php?file=../../resources/square200.png&allow=true");
assert_equals(entries.length, 1, "200.png should load successfully once, as the server is using Access-Control-Allow-Origin: *");
assert_not_equals(entries[0].nextHopProtocol, '', "100.png should not be loaded");
entries = performance.getEntriesByName("http://localhost:8080/security/resources/image-access-control.php?file=../../resources/square20.png&allow=false");
assert_equals(entries.length, 1, "20.png should load successfully once, as it is loaded with no-cors");
assert_not_equals(entries[0].nextHopProtocol, '', "100.png should not be loaded");
}));
</script>
<video poster="http://localhost:8080/security/resources/image-access-control.php?file=../../resources/square100.png&allow=false" crossorigin>
</video>
<video poster="http://localhost:8080/security/resources/image-access-control.php?file=../../resources/square200.png&allow=true" crossorigin>
</video>
<video poster="http://localhost:8080/security/resources/image-access-control.php?file=../../resources/square20.png&allow=false">
</video>