| OLD | NEW |
| 1 <head> | 1 <head> |
| 2 <script> | 2 <script> |
| 3 if (window.testRunner) | 3 if (window.testRunner) |
| 4 testRunner.dumpAsText(); | 4 testRunner.dumpAsText(); |
| 5 | 5 |
| 6 var results=[]; | 6 var results=[]; |
| 7 function checkForPreload(url, shouldbe) { | 7 function checkForPreload(url, shouldbe) { |
| 8 var preloaded = internals.isPreloaded(url); | 8 var preloaded = internals.isPreloaded(url); |
| 9 if ((preloaded && shouldbe) || (!preloaded && !shouldbe)) | 9 if ((preloaded && shouldbe) || (!preloaded && !shouldbe)) |
| 10 results.push("PASS\n"); | 10 results.push("PASS\n"); |
| 11 else | 11 else |
| 12 results.push("FAIL\n"); | 12 results.push("FAIL\n"); |
| 13 } | 13 } |
| 14 function printResults(){ | 14 function printResults(){ |
| 15 for(var i = 0; i < results.length; i++) | 15 for(var i = 0; i < results.length; i++) |
| 16 document.getElementsByTagName("body")[0].appendChild(document.createText
Node(results[i])); | 16 document.getElementsByTagName("body")[0].appendChild(document.createText
Node(results[i])); |
| 17 } | 17 } |
| 18 | 18 |
| 19 </script> | 19 </script> |
| 20 <link href="resources/preloadedimports.css" rel="stylesheet"> |
| 20 <script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> | 21 <script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> |
| 21 <script> | 22 <script> |
| 22 checkForPreload("resources/big_mq.css", true); | 23 checkForPreload("resources/big_mq.css", true); |
| 23 checkForPreload("resources/small_mq.css", false); | 24 checkForPreload("resources/small_mq.css", false); |
| 25 checkForPreload("preloaded.css", true); |
| 26 checkForPreload("notpreloaded.css", false); |
| 24 </script> | 27 </script> |
| 25 <link href="resources/big_mq.css" rel="stylesheet" media="screen and (min-width:
800px)"> | 28 <link href="resources/big_mq.css" rel="stylesheet" media="screen and (min-width:
800px)"> |
| 26 <link href="resources/small_mq.css" rel="stylesheet" media="screen and (max-widt
h: 799px)"> | 29 <link href="resources/small_mq.css" rel="stylesheet" media="screen and (max-widt
h: 799px)"> |
| 27 <script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> | 30 <script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> |
| 28 | 31 |
| 29 <body> | 32 <body> |
| 30 <p>Preload scanner should preload only the relevant MQ external CSS</p> | 33 <p>Preload scanner should preload only the relevant MQ external CSS</p> |
| 31 <script> | 34 <script> |
| 32 printResults(); | 35 printResults(); |
| 33 </script> | 36 </script> |
| OLD | NEW |