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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove.html

Issue 1689903002: Fix adopt-iframe-src-attr-after-remove.html flaky failure, attempt 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove.html b/third_party/WebKit/LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove.html
index 217773dac5f33f86a25bf1fc5822d745f7b469df..bb9d8b16d7410d39518a416dc98d79875d69820d 100644
--- a/third_party/WebKit/LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove.html
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/adopt-iframe-src-attr-after-remove.html
@@ -7,18 +7,33 @@ if (window.testRunner) {
testRunner.waitUntilDone();
}
+var onload_completed = false;
+
+function runGC() {
+ gc();
+ onload_completed = true;
+
+}
+
+function adoptAfterLoaded(ifr) {
+ // Wait on onload's gc() to complete.
+ if (!onload_completed) {
+ setTimeout(function () { adoptAfterLoaded(ifr); }, 1);
+ return;
+ }
+ document.adoptNode(ifr.attributes["src"]);
+ if (window.testRunner)
+ testRunner.notifyDone();
+}
+
window.onload = function()
{
iframe.remove();
// Run the GC after this event handler has completed & back at the event loop.
- setTimeout(gc);
+ setTimeout(runGC);
}
document.addEventListener("DOMContentLoaded", function() {
- setTimeout(function() {
- document.adoptNode(iframe.attributes["src"]);
- if (window.testRunner)
- testRunner.notifyDone();
- }, 0);
+ setTimeout(function () { adoptAfterLoaded(iframe); }, 1);
}, false);
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698