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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 We pass if we don't crash under ASAN. 2 We pass if we don't crash under ASAN.
3 <iframe id=iframe src="../navigation/resources/blank.txt"></iframe> 3 <iframe id=iframe src="../navigation/resources/blank.txt"></iframe>
4 <script> 4 <script>
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
8 } 8 }
9 9
10 var onload_completed = false;
11
12 function runGC() {
13 gc();
14 onload_completed = true;
15
16 }
17
18 function adoptAfterLoaded(ifr) {
19 // Wait on onload's gc() to complete.
20 if (!onload_completed) {
21 setTimeout(function () { adoptAfterLoaded(ifr); }, 1);
22 return;
23 }
24 document.adoptNode(ifr.attributes["src"]);
25 if (window.testRunner)
26 testRunner.notifyDone();
27 }
28
10 window.onload = function() 29 window.onload = function()
11 { 30 {
12 iframe.remove(); 31 iframe.remove();
13 // Run the GC after this event handler has completed & back at the event loo p. 32 // Run the GC after this event handler has completed & back at the event loo p.
14 setTimeout(gc); 33 setTimeout(runGC);
15 } 34 }
16 35
17 document.addEventListener("DOMContentLoaded", function() { 36 document.addEventListener("DOMContentLoaded", function() {
18 setTimeout(function() { 37 setTimeout(function () { adoptAfterLoaded(iframe); }, 1);
19 document.adoptNode(iframe.attributes["src"]);
20 if (window.testRunner)
21 testRunner.notifyDone();
22 }, 0);
23 }, false); 38 }, false);
24 </script> 39 </script>
OLDNEW
« 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