WebKit Bugzilla
Attachment 358473 Details for
Bug 193184
: MessagePort is unexpectedly GC'ed after activity absence
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (test only)
bug-193184-20190107114300.patch (text/plain), 4.03 KB, created by
Yoshiaki Jitsukawa
on 2019-01-06 18:43:01 PST
(
hide
)
Description:
Patch (test only)
Filename:
MIME Type:
Creator:
Yoshiaki Jitsukawa
Created:
2019-01-06 18:43:01 PST
Size:
4.03 KB
patch
obsolete
>Subversion Revision: 239555 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 76c38d92500820641145ee49c7c8d94fec3584c1..37b28f18f2e5835ef806b37a6537a9e21020a3e5 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-01-06 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> >+ >+ MessagePort is unexpectedly GC'ed after activity absence >+ https://bugs.webkit.org/show_bug.cgi?id=193184 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/messaging/messageport-gc-after-xhr-expected.txt: Added. >+ * http/tests/messaging/messageport-gc-after-xhr.html: Added. >+ * http/tests/messaging/resources/delayed-response.cgi: Added. >+ * http/tests/messaging/resources/messageport-pong-after-xhr.html: Added. >+ > 2018-12-23 Carlos Garcia Campos <cgarcia@igalia.com> > > Unreviewed GTK+ gardening. Rebaseline fast/text/zero-font-size.html after r239539. >diff --git a/LayoutTests/http/tests/messaging/messageport-gc-after-xhr-expected.txt b/LayoutTests/http/tests/messaging/messageport-gc-after-xhr-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0f793f3cd90d149f85c22d19c6048922f99aabb0 >--- /dev/null >+++ b/LayoutTests/http/tests/messaging/messageport-gc-after-xhr-expected.txt >@@ -0,0 +1,3 @@ >+waiting... >+Post message to the iframe. >+PASS >diff --git a/LayoutTests/http/tests/messaging/messageport-gc-after-xhr.html b/LayoutTests/http/tests/messaging/messageport-gc-after-xhr.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e8f43ab30a071c284f883dfe73d9d3e4cddc6568 >--- /dev/null >+++ b/LayoutTests/http/tests/messaging/messageport-gc-after-xhr.html >@@ -0,0 +1,49 @@ >+<html> >+<body> >+<iframe id="ifrm" src="resources/messageport-pong-after-xhr.html" style="display:none"></iframe> >+<div id="result">waiting...</div> >+<script> >+ >+function gc() >+{ >+ if (window.GCController) >+ return GCController.collect(); >+ >+ for (let i = 0; i < 1000; i++) >+ new ArrayBuffer(1000); >+} >+ >+function log(msg) { >+ var div = document.createElement("div"); >+ div.appendChild(document.createTextNode(msg)); >+ document.getElementById("result").appendChild(div); >+} >+ >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} >+ >+window.onload = () => { >+ let { port1, port2 } = new MessageChannel(); >+ log("Post message to the iframe."); >+ document.getElementById('ifrm').contentWindow.postMessage("ping", "*", [port2]); >+ port1.onmessage = (e) => { >+ log("PASS"); >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ }; >+ >+ setTimeout(gc, 100); >+ setTimeout(gc, 200); >+ setTimeout(gc, 300); >+ >+ setTimeout(() => { >+ log("FAIL: Timeout."); >+ if (window.testRunner) >+ testRunner.notifyDone(); >+ }, 3000); >+}; >+</script> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/messaging/resources/delayed-response.cgi b/LayoutTests/http/tests/messaging/resources/delayed-response.cgi >new file mode 100755 >index 0000000000000000000000000000000000000000..4c4292ef69f5717db1164f0bd662d068ec6f97cc >--- /dev/null >+++ b/LayoutTests/http/tests/messaging/resources/delayed-response.cgi >@@ -0,0 +1,5 @@ >+#!/usr/bin/perl -w >+ >+sleep 1; >+print "Content-type: text/plain\n\n"; >+print "Hello World!"; >diff --git a/LayoutTests/http/tests/messaging/resources/messageport-pong-after-xhr.html b/LayoutTests/http/tests/messaging/resources/messageport-pong-after-xhr.html >new file mode 100644 >index 0000000000000000000000000000000000000000..52c0a0fa95626e72079cf2aff20533da3915bd39 >--- /dev/null >+++ b/LayoutTests/http/tests/messaging/resources/messageport-pong-after-xhr.html >@@ -0,0 +1,19 @@ >+<html> >+<body> >+<script> >+function receiver(e) { >+ if (!e.ports || !e.ports.length) { >+ return; >+ } >+ let port = e.ports[0]; >+ let xhr = new XMLHttpRequest(); >+ xhr.open("GET", "delayed-response.cgi"); >+ xhr.send(); >+ xhr.onload = () => { >+ port.postMessage("pong"); >+ }; >+} >+addEventListener('message', receiver, false); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193184
: 358473 |
358477