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

Unified Diff: LayoutTests/http/tests/loading/preload-image-srcset-src-preloaded-reverse-order.html

Issue 23861003: Enable srcset support in HTMLImageElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a flaky test Created 7 years, 3 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
Index: LayoutTests/http/tests/loading/preload-image-srcset-src-preloaded-reverse-order.html
diff --git a/LayoutTests/http/tests/loading/preload-image-srcset-src-preloaded-reverse-order.html b/LayoutTests/http/tests/loading/preload-image-srcset-src-preloaded-reverse-order.html
new file mode 100644
index 0000000000000000000000000000000000000000..dd6563f0d2576a30a35f822af199946eca54abcb
--- /dev/null
+++ b/LayoutTests/http/tests/loading/preload-image-srcset-src-preloaded-reverse-order.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+<script>
+ window.targetScaleFactor = 1;
+</script>
+<script src="../resources/srcset-helper.js"></script>
+<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=1000"></script>
+</head>
+<body>
+<script>
+ shouldBeFalse("internals.isPreloaded('resources/base-image2.png');");
+ shouldBeFalse("internals.isPreloaded('resources/base-image3.png');");
+ shouldBeTrue("internals.isPreloaded('resources/preload-test.jpg');");
+ shouldBeTrue("internals.isPreloaded('resources/image2.png');");
+</script>
+<div>This test passes if the fallback image (defined in the src attribute) is preloaded, and the 1x versions (defined in srcset) aren't,
+ even when srcset is defined first.</div>
+<div>The second image is here to make sure isPreloaded is working properly</div>
+<img height="100" width="100" srcset="resources/base-image3.png 3x, resources/base-image2.png 2x" src="resources/preload-test.jpg">
+<img src="resources/image2.png">
+</body>
+</html>
+

Powered by Google App Engine
This is Rietveld 408576698