Index: LayoutTests/http/tests/loading/preload-image-srcset-duplicate.html |
diff --git a/LayoutTests/http/tests/loading/preload-image-srcset-duplicate.html b/LayoutTests/http/tests/loading/preload-image-srcset-duplicate.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d4399b81862cfba13434df8db26e1006c92619bd |
--- /dev/null |
+++ b/LayoutTests/http/tests/loading/preload-image-srcset-duplicate.html |
@@ -0,0 +1,31 @@ |
+<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/preload-test.jpg');"); |
+ shouldBeFalse("internals.isPreloaded('resources/preload-test-duplicate.jpg');"); |
+ shouldBeTrue("internals.isPreloaded('resources/base-image1.png');"); |
+ shouldBeFalse("internals.isPreloaded('resources/base-image2.png');"); |
+ shouldBeFalse("internals.isPreloaded('resources/base-image3.png');"); |
+ shouldBeFalse("internals.isPreloaded('resources/dup-image1.png');"); |
+ shouldBeFalse("internals.isPreloaded('resources/dup-image2.png');"); |
+ shouldBeFalse("internals.isPreloaded('resources/dup-image3.png');"); |
+ shouldBeTrue("internals.isPreloaded('resources/image2.png');"); |
+</script> |
+<div>This test passes if the fallback image (defined in the src attribute) is not preloaded, the 1x version (defined in srcset) is, and none |
+ of the duplicate resources is preloaded.</div> |
+<div>The second image is here to make sure isPreloaded is working properly</div> |
+<img height="100" width="100" src="resources/preload-test.jpg" src="resources/preload-test-duplicate.jpg" |
+srcset="resources/base-image1.png 1x, resources/base-image3.png 3x, resources/base-image2.png 2x" |
+srcset="resources/dup-image1.png 1x, resources/dup-image3.png 3x, resources/dup-image2.png 2x"> |
+<img src="resources/image2.png"> |
+</body> |
+</html> |
+ |