| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
| 4 <script> | 4 <script> |
| 5 var t = async_test('Makes sure that preloaded resources are not downloaded a
gain when used'); | 5 var t = async_test('Makes sure that preloaded resources are not downloaded a
gain when used'); |
| 6 </script> | 6 </script> |
| 7 <link rel=preload href="../resources/dummy.js" as=script> | 7 <link rel=preload href="../resources/dummy.js" as=script> |
| 8 <link rel=preload href="../resources/dummy.css" as=style> | 8 <link rel=preload href="../resources/dummy.css" as=style> |
| 9 <link rel=preload href="../resources/square.png" as=image> | 9 <link rel=preload href="../resources/square.png" as=image> |
| 10 <link rel=preload href="../resources/square.png?background" as=image> | 10 <link rel=preload href="../resources/square.png?background" as=image> |
| 11 <link rel=preload href="../resources/Ahem.ttf" as=font crossorigin> | 11 <link rel=preload href="../resources/Ahem.ttf" as=font> |
| 12 <link rel=preload href="http://crossorigin.test:8000/security/resources/cors-fon
t.php" as=font crossorigin> |
| 12 <link rel=preload href="../resources/test.mp4" as=media> | 13 <link rel=preload href="../resources/test.mp4" as=media> |
| 13 <link rel=preload href="../resources/test.oga" as=media> | 14 <link rel=preload href="../resources/test.oga" as=media> |
| 14 <link rel=preload href="../security/resources/captions.vtt" as=track> | 15 <link rel=preload href="../security/resources/captions.vtt" as=track> |
| 15 <link rel=preload href="../resources/dummy.xml" as=foobarxmlthing> | 16 <link rel=preload href="../resources/dummy.xml" as=foobarxmlthing> |
| 16 <link rel=preload href="../resources/dummy.xml"> | 17 <link rel=preload href="../resources/dummy.xml"> |
| 17 <script src="../resources/slow-script.pl?delay=200"></script> | 18 <script src="../resources/slow-script.pl?delay=200"></script> |
| 18 <style> | 19 <style> |
| 19 #background { | 20 #background { |
| 20 width: 200px; | 21 width: 200px; |
| 21 height: 200px; | 22 height: 200px; |
| 22 background-image: url(../resources/square.png?background); | 23 background-image: url(../resources/square.png?background); |
| 23 } | 24 } |
| 24 @font-face { | 25 @font-face { |
| 25 font-family:ahem; | 26 font-family:ahem; |
| 26 src: url(../resources/Ahem.ttf); | 27 src: url(../resources/Ahem.ttf); |
| 27 } | 28 } |
| 28 span { font-family: ahem, Arial; } | 29 @font-face { |
| 30 font-family:corsahem; |
| 31 src: url(http://crossorigin.test:8000/security/resources/cors-font.php); |
| 32 } |
| 33 #ahem { font-family: ahem, Arial; } |
| 34 #cors { font-family: corsahem, Arial; } |
| 29 </style> | 35 </style> |
| 30 <link rel="stylesheet" href="../resources/dummy.css"> | 36 <link rel="stylesheet" href="../resources/dummy.css"> |
| 31 <script src="../resources/dummy.js"></script> | 37 <script src="../resources/dummy.js"></script> |
| 32 <div id="background"></div> | 38 <div id="background"></div> |
| 33 <img src="../resources/square.png"> | 39 <img src="../resources/square.png"> |
| 34 <script src="../resources/slow-script.pl?delay=200"></script> | 40 <script src="../resources/slow-script.pl?delay=200"></script> |
| 35 <video src="../resources/test.mp4"> | 41 <video src="../resources/test.mp4"> |
| 36 <track kind=subtitles src="../security/resources/captions.vtt" srclang=en> | 42 <track kind=subtitles src="../security/resources/captions.vtt" srclang=en> |
| 37 </video> | 43 </video> |
| 38 <audio src="../resources/test.oga"></audio> | 44 <audio src="../resources/test.oga"></audio> |
| 39 <script> | 45 <script> |
| 40 var xhr = new XMLHttpRequest(); | 46 var xhr = new XMLHttpRequest(); |
| 41 xhr.open("GET", "../resources/dummy.xml"); | 47 xhr.open("GET", "../resources/dummy.xml"); |
| 42 xhr.send(); | 48 xhr.send(); |
| 43 | 49 |
| 44 window.addEventListener("load", t.step_func(function() { | 50 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 | 51 // 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); | 52 assert_equals(performance.getEntriesByType("resource").length, 15); |
| 47 t.done(); | 53 t.done(); |
| 48 })); | 54 })); |
| 49 </script> | 55 </script> |
| 50 <span>PASS - this text is here just so that the browser will download the font.<
/span | 56 <span id=ahem>PASS - this text is here just so that the browser will download th
e font.</span><span id=cors>and the other font.</span |
| OLD | NEW |