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

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

Issue 2227423002: Use testharness.js instead of js-test.js in fast/images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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..ef5515c541eea2f6b8bb693229503150df618c22 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,15 @@
<!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>
Srirama 2016/08/10 06:59:47 nit: remove the quotes.
sivag 2016/08/10 09:17:48 Done.
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<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() {
- 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();
-};
+async_test(function(t) {
Srirama 2016/08/10 06:59:47 Please check if you can use synchronous test inste
sivag 2016/08/10 09:17:48 Done.
+ var img = new Image();
+ img.style = "max-width: 100%";
+ img.src = "../replaced/resources/1x1-blue.png";
+ img.onload = t.step_func_done(function() {
+ img.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAMAAAAoyzS7AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAGUExURf8AAAAAAEGjEgMAAAAMSURBVHjaYmAACDAAAAIAAU9tWeEAAAAASUVORK5CYII=";
+ assert_equals(window.internals.needsLayoutCount(), 0);
Srirama 2016/08/10 06:59:47 nit: you can omit window prefix.
sivag 2016/08/10 09:17:48 Done.
+ });
+});
</script>
-<body onload="runTest();">
-<div style="float: left;">
- <img id="image" style="max-width: 100%" src="../replaced/resources/1x1-blue.png">
-</div>

Powered by Google App Engine
This is Rietveld 408576698