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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/intercept-postmessage.html

Issue 1973133002: ✀ Remove postMessage plumbing for swappedout:// ✀ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to use std::move instead of release(). Created 4 years, 7 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body><pre id="console"></pre></body>
4 <script>
5 function write(str) {
6 pre = document.getElementById('console');
7 text = document.createTextNode(str + '\n');
8 pre.appendChild(text);
9 }
10
11 function recvMsg1(e) {
12 write("RECV1");
13 window.removeEventListener("message", recvMsg1, false);
14
15 if (window.testRunner)
16 testRunner.interceptPostMessage = true;
17
18 window.addEventListener("message", recvMsg2, false);
19 window.postMessage("Message 2", "*");
20
21 // Ensure that we're intercepting postMessages before the origin check
22 window.postMessage("Message 3", "http://example.org");
23
24 if (window.testRunner) {
25 // We need to call setTimeout here because we intercept the next event.
26 window.setTimeout(function() { testRunner.notifyDone(); });
27 }
28 }
29
30 function recvMsg2(e) {
31 write("RECV2");
32 }
33
34 window.addEventListener("message", recvMsg1, false);
35
36 if (window.testRunner) {
37 window.testRunner.dumpAsText();
38 window.testRunner.waitUntilDone();
39 }
40
41 window.postMessage("Message 1", "*");
42 </script>
43 </html>
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698