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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/multipart/stop-loading.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 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 if (window.internals) {
11 assert_true(internals.isLoading("resources/multipart.php?interval=1&loop =1&img1=2x2-green.png&img2=abe.png"), "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:57:00 Done.
12 }
11 window.stop(); 13 window.stop();
12 window.setTimeout(function() { 14 window.setTimeout(t.step_func(function() {
13 var broken = (testingImage.width != 2 && testingImage.width != 76); 15 if (window.internals) {
14 document.getElementById("results").innerHTML = broken ? "PASS" : "FAIL"; 16 assert_false(internals.isLoading("resources/multipart.php?interval=1 &loop=1&img1=2x2-green.png&img2=abe.png"), "The image should not be loading befo re window.stop().");
yhirano 2016/11/29 01:59:39 after
hiroshige 2016/11/29 07:57:00 Done.
15 if (window.testRunner) 17 }
16 testRunner.notifyDone(); 18 t.done();
17 }, 100); 19 }), 100);
18 } 20 }
19 </script> 21 </script>
20 </head> 22 </head>
21 <body> 23 <body>
22 <img id=testingImage src="resources/multipart.php?interval=1&loop=1&img1=2x2-gre en.png&img2=abe.png" onload="firstPartLoaded()"> 24 <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> 25 </body>
25 </html> 26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698