| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 3 <script> | 5 <script> |
| 4 if (window.testRunner) { | 6 var t = async_test("window.stop() can stop loading of multipart images"); |
| 5 testRunner.dumpAsText(); | |
| 6 testRunner.waitUntilDone(); | |
| 7 } | |
| 8 | 7 |
| 9 function firstPartLoaded() | 8 function firstPartLoaded() |
| 10 { | 9 { |
| 10 const url = "resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&im
g2=abe.png"; |
| 11 if (window.internals) { |
| 12 assert_true(internals.isLoading(url), "The image should be loading befor
e window.stop()."); |
| 13 } |
| 11 window.stop(); | 14 window.stop(); |
| 12 window.setTimeout(function() { | 15 window.setTimeout(t.step_func(function() { |
| 13 var broken = (testingImage.width != 2 && testingImage.width != 76); | 16 if (window.internals) { |
| 14 document.getElementById("results").innerHTML = broken ? "PASS" : "FAIL"; | 17 assert_false(internals.isLoading(url), "The image should not be load
ing after window.stop()."); |
| 15 if (window.testRunner) | 18 } |
| 16 testRunner.notifyDone(); | 19 t.done(); |
| 17 }, 100); | 20 }), 100); |
| 18 } | 21 } |
| 19 </script> | 22 </script> |
| 20 </head> | 23 </head> |
| 21 <body> | 24 <body> |
| 22 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre
en.png&img2=abe.png" onload="firstPartLoaded()"> | 25 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre
en.png&img2=abe.png" onload="t.step(firstPartLoaded)"> |
| 23 <p id="results"></p> | |
| 24 </body> | 26 </body> |
| 25 </html> | 27 </html> |
| OLD | NEW |