blob: a2eae135fbc93ad5a37915e7fa3f16de9336220d [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
var t = async_test('Makes sure that preloaded resources are not downloaded again when used');
</script>
<link rel=preload href="../resources/dummy.js" as=script>
<link rel=preload href="../resources/dummy.css" as=style>
<link rel=preload href="../resources/square.png" as=image>
<link rel=preload href="../resources/square.png?background" as=image>
<link rel=preload href="../resources/Ahem.ttf" as=font crossorigin>
<link rel=preload href="../resources/test.mp4" as=video>
<link rel=preload href="../resources/test.oga" as=audio>
<link rel=preload href="../resources/security/captions.vtt" as=track>
<link rel=preload href="../resources/dummy.xml" as=foobarxmlthing>
<link rel=preload href="../resources/dummy.xml">
<script src="../resources/slow-script.pl?delay=200"></script>
<style>
#background {
width: 200px;
height: 200px;
background-image: url(../resources/square.png?background);
}
@font-face {
font-family:ahem;
src: url(../resources/Ahem.ttf);
}
span { font-family: ahem, Arial; }
</style>
<link rel="stylesheet" href="../resources/dummy.css">
<script src="../resources/dummy.js"></script>
<div id="background"></div>
<img src="../resources/square.png">
<video src="../resources/test.mp4">
<track kind=subtitles src="../resources/security/captions.vtt" srclang=en>
</video>
<audio src="../resources/test/oga"></audio>
<script>
var xhr = new XMLHttpRequest();
xhr.open("GET", "../resources/dummy.xml");
xhr.send();
window.addEventListener("load", t.step_func(function() {
assert_equals(performance.getEntriesByType("resource").length, 12);
t.done();
}));
</script>
<span>PASS - this text is here just so that the browser will download the font.</span