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

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: Test changed as per comments. 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..b3aea6b1cc6d4d34069c201d19a2a4835c46d916 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,14 @@
<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_done(function() {
fs 2016/08/17 08:56:08 Does it still work/pass if you assert needsLayoutC
sivag 2016/08/17 09:00:09 yes it works fine.
fs 2016/08/17 10:27:46 Could you add that assertion too then? =)
sivag 2016/08/17 10:41:09 Done.
+ 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