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

Side by Side Diff: LayoutTests/fast/dom/HTMLImageElement/image-innerHTML.html

Issue 956333002: Refactor TimeBase to post tasks. Workers to use real Idle tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 8 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 | LayoutTests/fast/events/resources/subframe-stop-load-in-unload-handler-using-document-write.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script> 5 <script>
6 description("Tests that creating and setting the src of an image element inside an innerHTML actually loads the resource"); 6 description("Tests that creating and setting the src of an image element inside an innerHTML actually loads the resource");
7 jsTestIsAsync = true; 7 jsTestIsAsync = true;
8 8
9 var div = document.createElement('div'); 9 var div = document.createElement('div');
10 var div2 = document.createElement('div'); 10 var div2 = document.createElement('div');
11 var attemptedLoadDirect = false; 11 var attemptedLoadDirect = false;
12 var attemptedLoadIndirect = false; 12 var attemptedLoadIndirect = false;
13 var numEventsOutsanding = 3;
13 14
14 div.innerHTML = '<img src="../resources/abe.png" onload="attemptedLoadDirect = t rue;">'; 15 function maybeCheckResults() {
15 div2.innerHTML = '<div><img src="../resources/abe.png" onload="attemptedLoadIndi rect = true;"></div>'; 16 numEventsOutsanding--;
16 document.body.onload = function() { 17 if (numEventsOutsanding == 0) {
17 shouldBeTrue('attemptedLoadDirect'); 18 shouldBeTrue('attemptedLoadDirect');
18 shouldBeTrue('attemptedLoadIndirect'); 19 shouldBeTrue('attemptedLoadIndirect');
19 finishJSTest(); 20 finishJSTest();
20 }; 21 }
22 }
23
24 function onDirect() {
25 attemptedLoadDirect = true;
26 maybeCheckResults();
27 }
28
29 function onIndirect() {
30 attemptedLoadIndirect = true;
31 maybeCheckResults();
32 }
33
34 // The order in which these three events occur is undefined, and shouldn't matte r for this test.
35 div.innerHTML = '<img src="../resources/abe.png" onload="onDirect();">';
36 div2.innerHTML = '<div><img src="../resources/abe.png" onload="onIndirect();"></ div>';
37 document.body.onload = maybeCheckResults;
21 </script> 38 </script>
22 </body> 39 </body>
23 </html> 40 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/resources/subframe-stop-load-in-unload-handler-using-document-write.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698