Index: LayoutTests/fast/events/message-channel-gc.html |
=================================================================== |
--- LayoutTests/fast/events/message-channel-gc.html (revision 46558) |
+++ LayoutTests/fast/events/message-channel-gc.html (working copy) |
@@ -17,6 +17,20 @@ function log(message) |
document.getElementById("log").innerHTML += message + "<br>"; |
} |
+function done() |
+{ |
+ channel.port1.close(); |
+ channel.port2.close(); |
+ |
+ gc(); |
+ |
+ setTimeout(function() { |
+ log("DONE"); |
+ if (window.layoutTestController) |
+ layoutTestController.notifyDone() |
+ }, 0); |
+} |
+ |
if (window.layoutTestController) { |
layoutTestController.dumpAsText(); |
layoutTestController.waitUntilDone(); |
@@ -29,23 +43,13 @@ gc(); |
log("Should be 'bar': " + channel.port1.foo); |
channel.port1.onmessage = function() { log("onmessage"); } |
-channel.port1.addEventListener("message", function() { log("message listener"); }, false); |
+channel.port1.addEventListener("message", function() { log("message listener"); done(); }, false); |
gc(); |
channel.port1.start(); |
channel.port2.postMessage("msg"); |
gc(); |
-channel.port1.close(); |
-channel.port2.close(); |
- |
-gc(); |
- |
-setTimeout(function() { |
- log("DONE"); |
- if (window.layoutTestController) |
- layoutTestController.notifyDone() |
-}, 0); |
</script> |
</body> |