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

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

Issue 2903773002: Revert of Remove EventSender from ImageLoader (Closed)
Patch Set: Created 3 years, 6 months 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/resources/srcset-helper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698