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 8327ff68a5b351be6fec798f97979c9370794445..5b9f934abf9e42600b5a6173c28a745a4a1e0b65 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 |
| @@ -6,11 +6,15 @@ |
| <img style="max-width: 100%" src="../replaced/resources/1x1-blue.png"> |
| </div> |
| <script> |
| -//TODO(siva.gunturi): Use async_test and use asserts on image.onload and window.onload. |
| -test(function() { |
| - document.documentElement.offsetTop; |
| - var img = document.querySelector("img"); |
| - img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAGUExURf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII="; |
| - assert_equals(internals.needsLayoutCount(), 0); |
| +async_test(function(t) { |
| + window.onload = t.step_func(function() { |
| + document.documentElement.offsetTop; |
| + var img = document.querySelector("img"); |
| + img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAGUExURf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII="; |
| + img.onload = t.step_func(function() { |
|
Srirama
2016/08/17 07:14:57
use t.step_func_done and remove t.done below.
sivag
2016/08/17 07:25:46
Done.
|
| + assert_equals(internals.needsLayoutCount(), 0); |
| + t.done(); |
| + }); |
| + }); |
| }); |
| </script> |