Chromium Code Reviews| 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 // This tests window.stop() can stop loading of multipart images after | 6 var t = async_test("window.stop() can stop loading of multipart images " + | 
| 5 // <img>'s onload and one more part loaded after onload. | 7 "after <img>'s onload and " + | 
| 6 if (window.testRunner) { | 8 "after one more part loaded after onload."); | 
| 7 testRunner.dumpAsText(); | |
| 8 testRunner.waitUntilDone(); | |
| 9 } | |
| 10 | 9 | 
| 11 function callStop() | 10 function callStop() | 
| 12 { | 11 { | 
| 12 if (window.internals) { | |
| 13 assert_true(internals.isLoading("resources/multipart.php?interval=1&loop =1&img1=2x2-green.png&img2=abe.png&label=2"), "The image should be loading befor e 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:57:00
Done.
 
 | |
| 14 } | |
| 13 window.stop(); | 15 window.stop(); | 
| 14 window.setTimeout(function() { | 16 window.setTimeout(t.step_func(function() { | 
| 15 var broken = (testingImage.width != 2 && testingImage.width != 76); | 17 if (window.internals) { | 
| 16 document.getElementById("results").innerHTML = broken ? "PASS" : "FAIL"; | 18 assert_false(internals.isLoading("resources/multipart.php?interval=1 &loop=1&img1=2x2-green.png&img2=abe.png&label=2"), "The image should not be load ing before window.stop()."); | 
| 
 
yhirano
2016/11/29 01:59:39
after
 
hiroshige
2016/11/29 07:57:00
Done.
 
 | |
| 17 if (window.testRunner) | 19 } | 
| 18 testRunner.notifyDone(); | 20 t.done(); | 
| 19 }, 100); | 21 }), 100); | 
| 20 } | 22 } | 
| 21 | 23 | 
| 22 function firstPartLoaded() | 24 function firstPartLoaded() | 
| 23 { | 25 { | 
| 24 setTimeout(callStop, 1500); | 26 setTimeout(t.step_func(callStop), 1500); | 
| 25 } | 27 } | 
| 26 </script> | 28 </script> | 
| 27 </head> | 29 </head> | 
| 28 <body> | 30 <body> | 
| 29 <!-- |label| is added to avoid interaction between stop-loading* tests --> | 31 <!-- |label| is added to avoid interaction between stop-loading* tests --> | 
| 30 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre en.png&img2=abe.png&label=2" onload="firstPartLoaded()"> | 32 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre en.png&img2=abe.png&label=2" onload="firstPartLoaded()"> | 
| 31 <p id="results"></p> | |
| 32 </body> | 33 </body> | 
| 33 </html> | 34 </html> | 
| OLD | NEW |