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

Unified Diff: chrome/test/data/post_message.html

Issue 9108001: Adds support for calling postMessage on a frame living in a different renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Invert check. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/click-noreferrer-links.html ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/post_message.html
diff --git a/chrome/test/data/post_message.html b/chrome/test/data/post_message.html
new file mode 100644
index 0000000000000000000000000000000000000000..76ea08d996eb60776fbac0981c42eded634115a4
--- /dev/null
+++ b/chrome/test/data/post_message.html
@@ -0,0 +1,29 @@
+<html>
+
+ <head><title>Post message tests</title>
+ <script>
+ // Send a message to our opener, and it will reply.
+ function postToOpener(msg, origin) {
+ window.opener.postMessage(msg, origin);
+ return true;
+ }
+
+ // Send a message to a window named "foo".
+ function postToFoo(msg) {
+ var w = window.open("", "foo");
+ w.postMessage(msg, "*");
+ return true;
+ }
+
+ // Listen to incoming messages.
+ var receivedMessages = 0;
+ window.addEventListener("message", messageReceived, false);
+ function messageReceived(event) {
+ receivedMessages++;
+ // Change the title to generate a notification.
+ document.title = event.data;
+ }
+ </script>
+ </head>
+
+</html>
« no previous file with comments | « chrome/test/data/click-noreferrer-links.html ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698