| Index: LayoutTests/http/tests/loading/preload-css-test.html
|
| diff --git a/LayoutTests/http/tests/loading/preload-css-test.html b/LayoutTests/http/tests/loading/preload-css-test.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..627cff66f6047663a36e6a15aa382933457561aa
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/loading/preload-css-test.html
|
| @@ -0,0 +1,33 @@
|
| +<head>
|
| +<script>
|
| +if (window.testRunner)
|
| + testRunner.dumpAsText();
|
| +
|
| +var results=[];
|
| +function checkForPreload(url, shouldbe) {
|
| + var preloaded = internals.isPreloaded(url);
|
| + if ((preloaded && shouldbe) || (!preloaded && !shouldbe))
|
| + results.push("PASS\n");
|
| + else
|
| + results.push("FAIL\n");
|
| +}
|
| +function printResults(){
|
| + for(var i = 0; i < results.length; i++)
|
| + document.getElementsByTagName("body")[0].appendChild(document.createTextNode(results[i]));
|
| +}
|
| +
|
| +</script>
|
| +<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=1000"></script>
|
| +<script>
|
| +checkForPreload("resources/big_mq.css", true);
|
| +checkForPreload("resources/small_mq.css", false);
|
| +</script>
|
| +<link href="resources/big_mq.css" rel="stylesheet" media="screen and (min-width: 800px)">
|
| +<link href="resources/small_mq.css" rel="stylesheet" media="screen and (max-width: 799px)">
|
| +<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=1000"></script>
|
| +
|
| +<body>
|
| +<p>Preload scanner should preload only the relevant MQ external CSS</p>
|
| +<script>
|
| +printResults();
|
| +</script>
|
|
|