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

Unified Diff: third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.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: fix 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/natural-dimensions-correct-after-image-reset.html
diff --git a/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html b/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html
index f9c22460c0a0e2961549f16b9b12ef4015d8f30d..5ba8dc982c700291bf089115c24b612f60df93e2 100644
--- a/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html
+++ b/third_party/WebKit/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html
@@ -1,30 +1,15 @@
<!DOCTYPE html>
-<script src="../../resources/js-test.js"></script>
+<title>crbug.com/468915: Resetting or removing the src attribute should reset the image immediately, rather than waiting for an asynchronous load to do it.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<script>
- if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.dumpAsText();
- }
- img = new Image();
- var testImage = 'resources/green.jpg';
- img.onload = function(){
+async_test(function(t) {
+ var img = new Image();
+ img.onload = t.step_func_done(function() {
+ assert_equals(img.naturalWidth, 16);
img.removeAttribute('src');
- if (img.naturalWidth > 0) {
- debug("Natural width is : " + img.naturalWidth + " and should be 0.");
- if (window.testRunner)
- testRunner.notifyDone();
- return;
- }
- document.getElementById('result').textContent = "PASS";
- if (window.testRunner)
- testRunner.notifyDone();
- };
- setTimeout(function() {
- img.src = testImage;
- }, 0);
+ assert_equals(img.naturalWidth, 0);
+ });
+ img.src = 'resources/green.jpg';
+});
</script>
-<div id="console">
- crbug.com/468915: Resetting or removing the src attribute should reset the image immediately, rather than waiting for an asynchronous load to do it.<br>
-</div>
-<div id="result">FAIL</div>
-

Powered by Google App Engine
This is Rietveld 408576698