Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: LayoutTests/http/tests/loading/preload-css-test.html

Issue 13945017: External Stylesheets preloaded according to their media attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/loading/preload-css-test-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/http/tests/loading/preload-css-test-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698