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

Unified Diff: LayoutTests/http/tests/xmlhttprequest/event-listener-gc.html

Issue 1201393003: Unflake http/tests/xmlhttprequest/event-listener-gc.html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 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: LayoutTests/http/tests/xmlhttprequest/event-listener-gc.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/event-listener-gc.html b/LayoutTests/http/tests/xmlhttprequest/event-listener-gc.html
index c8a665217d93c4ce75ad976af7e5486c2e626237..ea8c5aae96c2c49676c8d0bc1f2333369e5fb2d4 100644
--- a/LayoutTests/http/tests/xmlhttprequest/event-listener-gc.html
+++ b/LayoutTests/http/tests/xmlhttprequest/event-listener-gc.html
@@ -8,7 +8,7 @@ function write(s)
}
var didCollect = false;
-function collect()
+window.onmessage = function ()
{
didCollect = true;
gc();
@@ -24,26 +24,27 @@ function processStateChange(e)
}
}
-function test()
+function test()
{
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
-
+
var request = new XMLHttpRequest();
request.onreadystatechange = processStateChange;
request.open("GET", "print-content-type.cgi", true);
request.send(null);
-
- setTimeout('collect();', 0); // timeout ensures stack references to request are cleared when we collect
+
+ // Indirectly GC so as to ensure that 'request' isn't stack reachable.
+ window.postMessage('gc!', '*');
}
</script>
</head>
<body onload="test();">
<p>This test checks whether event handlers for outstanding XMLHttpRequests survive garbage collection.</p>
-<p>See https://bugs.webkit.org/show_bug.cgi?id=9113 REGRESSION (14581):
+<p>See https://bugs.webkit.org/show_bug.cgi?id=9113 REGRESSION (14581):
XMLHttpRequest never calls onreadystatechange with a readystate == 4</p>
<p>If the test passes, you'll see a series of 'PASS' messages below.</p>
<hr>
« 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