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

Unified Diff: third_party/WebKit/LayoutTests/fast/images/image-change-without-resize-shouldnt-layout.html

Issue 2250323002: Handle window.onload and img.onload in image-change-without-resize-shouldnt-layout test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add assert just after img src change. Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5f1d904f4bbd66ce8febdd9ff0163af5d69f64a3 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=";
+ assert_equals(internals.needsLayoutCount(), 0);
+ img.onload = t.step_func_done(function() {
+ assert_equals(internals.needsLayoutCount(), 0);
+ });
+ });
});
</script>
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698