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> |