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

Side by Side Diff: LayoutTests/fast/dom/Window/post-message-detach-in-handler.html

Issue 1186093003: Reland: Window.postMessage() to self can cause document leaks (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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <script>
7 description("Test that detaching document in window.postMessage() handler does n ot crash.");
8
9 window.jsTestIsAsync = true;
10
11 if (window.testRunner) {
12 testRunner.dumpAsText();
13 testRunner.waitUntilDone();
14 }
15
16 function postMessageToSelf() {
17 setInterval(function() { iframe.contentWindow.postMessage("msg", "*"); }, 0) ;
18 }
19
20 function receiveMessage(event) {
21 testPassed("Received message " + event.data);
22 document.body.removeChild(iframe);
23 finishJSTest();
24 }
25
26 var iframe = document.createElement("iframe");
27 document.body.appendChild(iframe);
28 iframe.contentWindow.addEventListener("message", receiveMessage, false);
29 postMessageToSelf();
30 </script>
31 </body>
32 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698