4 testRunner
.dumpAsText();
7 function checkForPreload(url
, shouldbe
) {
8 var preloaded
= internals
.isPreloaded(url
);
9 if ((preloaded
&& shouldbe
) || (!preloaded
&& !shouldbe
))
10 results
.push("PASS\n");
12 results
.push("FAIL\n");
14 function printResults(){
15 for(var i
= 0; i
< results
.length
; i
++)
16 document
.getElementsByTagName("body")[0].appendChild(document
.createTextNode(results
[i
]));
20 <script src=
"http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script>
22 checkForPreload("resources/big_mq.css", true);
23 checkForPreload("resources/small_mq.css", false);
25 <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-width: 799px)">
27 <script src=
"http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script>
30 <p>Preload scanner should preload only the relevant MQ external CSS
</p>