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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading-after-onload1.html

Issue 1840933002: Do not rely on broken images in http/tests/multipart/ tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years 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 unified diff | Download patch
OLDNEW
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 before the next part loaded after onload. 7 "after <img>'s onload and " +
6 if (window.testRunner) { 8 "before the next part loaded after onload.");
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
9 }
10 9
11 function callStop() 10 function callStop()
12 { 11 {
12 const url = "resources/multipart.php?interval=1&loop=1&img1=2x2-green.png&im g2=abe.png&label=1";
13 if (window.internals) {
14 assert_true(internals.isLoading(url), "The image should be loading befor e window.stop().");
15 }
13 window.stop(); 16 window.stop();
14 window.setTimeout(function() { 17 window.setTimeout(t.step_func(function() {
15 var broken = (testingImage.width != 2 && testingImage.width != 76); 18 if (window.internals) {
16 document.getElementById("results").innerHTML = broken ? "PASS" : "FAIL"; 19 assert_false(internals.isLoading(url), "The image should not be load ing after window.stop().");
17 if (window.testRunner) 20 }
18 testRunner.notifyDone(); 21 t.done();
19 }, 100); 22 }), 100);
20 } 23 }
21 24
22 function firstPartLoaded() 25 function firstPartLoaded()
23 { 26 {
24 setTimeout(callStop, 0); 27 setTimeout(t.step_func(callStop), 0);
25 } 28 }
26 </script> 29 </script>
27 </head> 30 </head>
28 <body> 31 <body>
29 <!-- |label| is added to avoid interaction between stop-loading* tests --> 32 <!-- |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=1" onload="firstPartLoaded()"> 33 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre en.png&img2=abe.png&label=1" onload="firstPartLoaded()">
31 <p id="results"></p>
32 </body> 34 </body>
33 </html> 35 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698