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

Unified Diff: LayoutTests/fast/hidpi/image-srcset-intrinsic-size.html

Issue 25105004: Use srcset's resource pixel density to determine intrinsic size (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cleantests
Patch Set: Fixed crash+rebased Created 7 years, 2 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/fast/hidpi/image-srcset-intrinsic-size.html
diff --git a/LayoutTests/fast/hidpi/image-srcset-intrinsic-size.html b/LayoutTests/fast/hidpi/image-srcset-intrinsic-size.html
new file mode 100644
index 0000000000000000000000000000000000000000..4f78712176ba56bb14f12f689cdb149392668ae1
--- /dev/null
+++ b/LayoutTests/fast/hidpi/image-srcset-intrinsic-size.html
@@ -0,0 +1,30 @@
+<html>
+<head>
+<script>
+ window.targetScaleFactor = 2;
+</script>
+<script src="resources/srcset-helper.js"></script>
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+ addEventListener("load", function() {
+ shouldBeTrue('document.getElementById("foo").clientWidth==200');
+ shouldBeTrue('document.getElementById("foo2").clientWidth==400');
+ shouldBeTrue('document.getElementById("foo3").clientWidth==100');
+ shouldBeTrue('document.getElementById("foo4").clientWidth==200');
+ }, false);
+</script>
+</head>
+
+<body id="body">
+ <div>
+ This test passes if the images are all displayed with appropriate dimensions.
+ </div>
+ <img id="foo" srcset="resources/blue-100-px-square.png 1x, resources/deleteButton.png 3x, resources/green-200-px-square.png 2x">
+ <br>
+ <img id="foo2" src="resources/green-200-px-square.png">
+ <br>
+ <img id="foo3" srcset="resources/srcset.svg 2x">
+ <br>
+ <img id="foo4" src="resources/srcset.svg">
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698