OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <script src="/resources/testharness.js"></script> | |
3 <script src="/resources/testharnessreport.js"></script> | |
4 <script> | |
5 var t = async_test('Makes sure that preloaded resources are not downloaded a
gain when used'); | |
6 </script> | |
7 <link rel=preload href="resources/dummy.js" as=script> | |
8 <link rel=preload href="resources/dummy.css" as=style> | |
9 <link rel=preload href="resources/square.png" as=image> | |
10 <link rel=preload href="resources/square.png?background" as=image> | |
11 <link rel=preload href="/fonts/CanvasTest.ttf" as=font crossorigin> | |
12 <link rel=preload href="/media/white.mp4" as=media> | |
13 <link rel=preload href="/media/sound_5.oga" as=media> | |
14 <link rel=preload href="/media/foo.vtt" as=media> | |
15 <link rel=preload href="resources/dummy.xml?foo=bar" as=foobarxmlthing> | |
16 <link rel=preload href="resources/dummy.xml"> | |
17 <body> | |
18 <script src="resources/dummy.js?pipe=trickle(d5)"></script> | |
19 <style> | |
20 #background { | |
21 width: 200px; | |
22 height: 200px; | |
23 background-image: url(resources/square.png?background); | |
24 } | |
25 @font-face { | |
26 font-family:ahem; | |
27 src: url(/fonts/CanvasTest.ttf); | |
28 } | |
29 span { font-family: ahem, Arial; } | |
30 </style> | |
31 <link rel="stylesheet" href="resources/dummy.css"> | |
32 <script src="resources/dummy.js"></script> | |
33 <div id="background"></div> | |
34 <img src="resources/square.png"> | |
35 <video src="/media/white.mp4"> | |
36 <track kind=subtitles src="/media/foo.vtt" srclang=en> | |
37 </video> | |
38 <audio src="/media/sound_5.oga"></audio> | |
39 <script> | |
40 var xhr = new XMLHttpRequest(); | |
41 xhr.open("GET", "resources/dummy.xml"); | |
42 xhr.send(); | |
43 | |
44 window.addEventListener("load", t.step_func(function() { | |
45 // Audio and video show 2 extra requests as the main request is followed
by a range request | |
46 assert_equals(performance.getEntriesByType("resource").length, 14); | |
47 t.done(); | |
48 })); | |
49 </script> | |
50 <span>PASS - this text is here just so that the browser will download the font.<
/span> | |
OLD | NEW |