| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../resources/testharness.js"></script> | 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> | 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 <script> | 5 <script> |
| 6 var t = async_test("window.stop() can stop loading of multipart images"); | 6 var t = async_test("window.stop() can stop loading of multipart images"); |
| 7 | 7 |
| 8 function firstPartLoaded() | 8 function firstPartLoaded() |
| 9 { | 9 { |
| 10 const url = "resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&im
g2=abe.png"; | 10 const url = "resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&im
g2=abe.png"; |
| 11 if (window.internals) { | 11 if (window.internals) { |
| 12 assert_true(internals.isLoading(url), "The image should be loading befor
e window.stop()."); | 12 assert_true(internals.isLoading(url), "The image should be loading befor
e window.stop()."); |
| 13 } | 13 } |
| 14 window.stop(); | 14 window.stop(); |
| 15 | |
| 16 // We emulate window load event to signal testharness.js that we don't | |
| 17 // have to wait for window load event (that will never occur because | |
| 18 // we've called window.stop()) before test completes. | |
| 19 dispatchEvent(new Event('load')); | |
| 20 | |
| 21 window.setTimeout(t.step_func(function() { | 15 window.setTimeout(t.step_func(function() { |
| 22 if (window.internals) { | 16 if (window.internals) { |
| 23 assert_false(internals.isLoading(url), "The image should not be load
ing after window.stop()."); | 17 assert_false(internals.isLoading(url), "The image should not be load
ing after window.stop()."); |
| 24 } | 18 } |
| 25 t.done(); | 19 t.done(); |
| 26 }), 100); | 20 }), 100); |
| 27 } | 21 } |
| 28 </script> | 22 </script> |
| 29 </head> | 23 </head> |
| 30 <body> | 24 <body> |
| 31 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre
en.png&img2=abe.png" onload="t.step(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)"> |
| 32 </body> | 26 </body> |
| 33 </html> | 27 </html> |
| OLD | NEW |