| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script> | 2 <script> |
| 3 window.targetScaleFactor = 2; | 3 window.targetScaleFactor = 2; |
| 4 </script> | 4 </script> |
| 5 <script src="resources/srcset-helper.js"></script> | 5 <script src="resources/srcset-helper.js"></script> |
| 6 <script src="../../resources/js-test.js"></script> | 6 <script src="../../resources/js-test.js"></script> |
| 7 <script> | 7 <script> |
| 8 var imgWidth; | 8 var imgWidth; |
| 9 addEventListener("load", function() { | 9 addEventListener("load", function() { |
| 10 imgWidth = document.getElementById("foo").clientWidth; | 10 imgWidth = document.getElementById("foo").clientWidth; |
| 11 shouldBe('imgWidth', '33554431' /* blink::intMaxForLayoutUnit */); | 11 var expected = 33554431; // blink::intMaxForLayoutUnit |
| 12 if (sessionStorage.useZoomForDsfEnabled === 'true') |
| 13 expected = Math.round(expected / window.devicePixelRatio); |
| 14 shouldBe('imgWidth', '' + expected); |
| 12 }, false); | 15 }, false); |
| 13 </script> | 16 </script> |
| 14 <div> | 17 <div> |
| 15 This test passes if the image is displayed with infinite dimensions. | 18 This test passes if the image is displayed with infinite dimensions. |
| 16 </div> | 19 </div> |
| 17 <img id="foo" srcset="resources/blue-100-px-square.png 0x"> | 20 <img id="foo" srcset="resources/blue-100-px-square.png 0x"> |
| OLD | NEW |