Index: LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change.html |
diff --git a/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change.html b/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5538d5befef930b5f1132391c1da53c84e1bf42d |
--- /dev/null |
+++ b/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change.html |
@@ -0,0 +1,32 @@ |
+<html> |
+<head> |
+<script src="../../hidpi/resources/srcset-helper.js"></script> |
+<script src="../../../resources/js-test.js"></script> |
+<script> |
+ if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+ function updateSrc() { |
+ var img = document.getElementById("foo"); |
+ // sizes must be set first, then srcset must be set, the 'src' |
+ // This will be fixed when image loading is done is "stable-state" |
+ img.sizes = "400px"; |
+ img.srcset = "../../hidpi/resources/image-set-1x.png 200w, ../../hidpi/resources/image-set-2x.png 400w, resources/image-set-4x.png 800w"; |
+ img.src = "resources/blue-100-px-square.png" |
+ } |
+ |
+ addEventListener("DOMContentLoaded", function() { |
+ if (window.testRunner && sessionStorage.pageReloaded) |
+ testRunner.dumpResourceRequestCallbacks(); |
+ updateSrc(); |
+ }, false); |
+ addEventListener("load", function() { |
+ shouldBe('document.getElementById("foo").currentSrc', '"resources/image-set-4x.png"'); |
+ }, false); |
+</script> |
+</head> |
+ |
+<body id="body"> |
+ <img id="foo"> |
+</body> |
+</html> |