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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/HTMLImageElement/image-innerHTML.html
diff --git a/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML.html b/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML.html
index 8ab8575df473fdb9880b29e0a052e95b78311d34..a5b4c4ab6266fe0ea3f995369048e9f2644823f3 100644
--- a/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML.html
+++ b/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML.html
@@ -10,14 +10,31 @@ var div = document.createElement('div');
var div2 = document.createElement('div');
var attemptedLoadDirect = false;
var attemptedLoadIndirect = false;
+var numEventsOutsanding = 3;
-div.innerHTML = '<img src="../resources/abe.png" onload="attemptedLoadDirect = true;">';
-div2.innerHTML = '<div><img src="../resources/abe.png" onload="attemptedLoadIndirect = true;"></div>';
-document.body.onload = function() {
- shouldBeTrue('attemptedLoadDirect');
- shouldBeTrue('attemptedLoadIndirect');
- finishJSTest();
-};
+function maybeCheckResults() {
+ numEventsOutsanding--;
+ if (numEventsOutsanding == 0) {
+ shouldBeTrue('attemptedLoadDirect');
+ shouldBeTrue('attemptedLoadIndirect');
+ finishJSTest();
+ }
+}
+
+function onDirect() {
+ attemptedLoadDirect = true;
+ maybeCheckResults();
+}
+
+function onIndirect() {
+ attemptedLoadIndirect = true;
+ maybeCheckResults();
+}
+
+// The order in which these three events occur is undefined, and shouldn't matter for this test.
+div.innerHTML = '<img src="../resources/abe.png" onload="onDirect();">';
+div2.innerHTML = '<div><img src="../resources/abe.png" onload="onIndirect();"></div>';
+document.body.onload = maybeCheckResults;
</script>
</body>
</html>
« 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