Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html b/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html |
| index dfcf6bc3defe45f84ab85292d7773ed5c046d26a..514e04496c7198d7b0dcc36449ddceedfbbef8ad 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html |
| @@ -1,33 +1,34 @@ |
| <html> |
| <head> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| <script> |
| -// This tests window.stop() can stop loading of multipart images after |
| -// <img>'s onload and before the next part loaded after onload. |
| -if (window.testRunner) { |
| - testRunner.dumpAsText(); |
| - testRunner.waitUntilDone(); |
| -} |
| +var t = async_test("window.stop() can stop loading of multipart images " + |
| + "after <img>'s onload and " + |
| + "before the next part loaded after onload."); |
| function callStop() |
| { |
| + if (window.internals) { |
| + assert_true(internals.isLoading("resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png&label=1"), "The image should be loading before window.stop()."); |
|
yhirano
2016/11/29 01:59:39
Is it a good idea to have a constant for the url i
hiroshige
2016/11/29 07:56:59
Done.
|
| + } |
| window.stop(); |
| - window.setTimeout(function() { |
| - var broken = (testingImage.width != 2 && testingImage.width != 76); |
| - document.getElementById("results").innerHTML = broken ? "PASS" : "FAIL"; |
| - if (window.testRunner) |
| - testRunner.notifyDone(); |
| - }, 100); |
| + window.setTimeout(t.step_func(function() { |
| + if (window.internals) { |
| + assert_false(internals.isLoading("resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png&label=1"), "The image should not be loading before window.stop()."); |
|
yhirano
2016/11/29 01:59:39
after
hiroshige
2016/11/29 07:56:59
Done.
|
| + } |
| + t.done(); |
| + }), 100); |
| } |
| function firstPartLoaded() |
| { |
| - setTimeout(callStop, 0); |
| + setTimeout(t.step_func(callStop), 0); |
| } |
| </script> |
| </head> |
| <body> |
| <!-- |label| is added to avoid interaction between stop-loading* tests --> |
| <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&img2=abe.png&label=1" onload="firstPartLoaded()"> |
| -<p id="results"></p> |
| </body> |
| </html> |