Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/images/image-change-without-resize-shouldnt-layout.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/images/image-change-without-resize-shouldnt-layout.html b/third_party/WebKit/LayoutTests/fast/images/image-change-without-resize-shouldnt-layout.html |
| index 015cae4fc34ba65e5911026144ae9bf0699e4b3f..f512a7123bb43a555e388d23215d696766f850dd 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/images/image-change-without-resize-shouldnt-layout.html |
| +++ b/third_party/WebKit/LayoutTests/fast/images/image-change-without-resize-shouldnt-layout.html |
| @@ -1,22 +1,19 @@ |
| <!DOCTYPE html> |
| -<script src="../../resources/js-test.js"></script> |
| +<title>This test ensures that when an image changes, but doesn't change size (like in an Animated GIF), we don't force a Layout.</title> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<div style="float: left;"> |
| +<img style="max-width: 100%" src="../replaced/resources/1x1-blue.png"> |
| +</div> |
| <script> |
| -description("This test ensures that when an image changes, but doesn't change size (like in an Animated GIF), we don't force a Layout.") |
| - |
| -if (window.testRunner) |
| - testRunner.waitUntilDone(); |
| - |
| -function runTest() { |
| +test(function() { |
| document.documentElement.offsetTop; |
| - var imageElement = document.getElementById("image"); |
| - imageElement.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAGUExURf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII=" |
| - if (window.internals) |
| - shouldBe("window.internals.needsLayoutCount()", "0"); |
| - if (window.testRunner) |
| - testRunner.notifyDone(); |
| -}; |
| + var img = document.querySelector("img"); |
| + if(img) { |
|
Srirama
2016/08/10 10:50:21
condition not required. you can remove it.
sivag
2016/08/10 11:21:53
Done.
|
| + img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAGUExURf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII="; |
| + assert_equals(internals.needsLayoutCount(), 0); |
| + return; |
|
Srirama
2016/08/10 10:50:21
you can omit the return and the assert stmt below.
sivag
2016/08/10 11:21:53
Done.
|
| + } |
| + assert_true(false, "Test Failed"); |
| +}); |
| </script> |
| -<body onload="runTest();"> |
| -<div style="float: left;"> |
| - <img id="image" style="max-width: 100%" src="../replaced/resources/1x1-blue.png"> |
| -</div> |