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

Side by Side Diff: content/test/data/post_message.html

Issue 10831056: Port the render_view_host_manager_browsertest.cc to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 2
3 <head><title>Post message tests</title> 3 <head><title>Post message tests</title>
4 <script> 4 <script>
5 // Send a message to our opener, and it will reply. 5 // Send a message to our opener, and it will reply.
6 function postToOpener(msg, origin) { 6 function postToOpener(msg, origin) {
7 window.opener.postMessage(msg, origin); 7 window.opener.postMessage(msg, origin);
8 return true; 8 return true;
9 } 9 }
10 10
11 // Send a message to a window named "foo". 11 // Send a message to a window named "foo".
12 function postToFoo(msg) { 12 function postToFoo(msg) {
13 var w = window.open("", "foo"); 13 var w = window.open("", "foo");
14 w.postMessage(msg, "*"); 14 w.postMessage(msg, "*");
15 return true; 15 return true;
16 } 16 }
17 17
18 // Listen to incoming messages. 18 // Listen to incoming messages.
19 var receivedMessages = 0; 19 var receivedMessages = 0;
20 window.addEventListener("message", messageReceived, false); 20 window.addEventListener("message", messageReceived, false);
21 function messageReceived(event) { 21 function messageReceived(event) {
22 receivedMessages++; 22 receivedMessages++;
23 // Change the title to generate a notification. 23 // Change the title to generate a notification.
24 document.title = event.data; 24 document.title = event.data;
25 } 25 }
26 </script> 26 </script>
27 </head> 27 </head>
28 28
29 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698