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

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

Issue 1046933005: Refactor postMessage for out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie's nits Created 5 years, 8 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 | « content/test/data/frame_tree/page_with_post_message_frames.html ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/post_message.html
diff --git a/content/test/data/post_message.html b/content/test/data/post_message.html
index 37adb8398d40ccff7cb5f9b61c9ec7d5ff8f1715..e111fea72f85d0fdf6c1388f37d0a67331d52dec 100644
--- a/content/test/data/post_message.html
+++ b/content/test/data/post_message.html
@@ -15,6 +15,18 @@
return true;
}
+ // Send a message to parent.
+ function postToParent(msg) {
+ parent.postMessage(msg, "*");
+ return true;
+ }
+
+ // Send a message to sibling.
+ function postToSibling(msg, sibling) {
+ parent.frames[sibling].postMessage(msg, "*");
+ return true;
+ }
+
// Send a message to a subframe of window named "foo".
function postToFooFrame(msg) {
var w = window.open("", "foo");
@@ -30,6 +42,11 @@
receivedMessages++;
if (event.data === "2-1-reply") {
event.source.postMessage("msg4", "*");
+ } else if (event.data === "subframe-msg") {
+ event.source.postMessage("subframe-msg-reply", "*");
+ } else if (event.data === "subframe-msg-reply") {
+ domAutomationController.setAutomationId(0);
+ domAutomationController.send("done-" + window.name);
}
if (event.ports.length > 0) {
receivedMessagesWithPort++;
« no previous file with comments | « content/test/data/frame_tree/page_with_post_message_frames.html ('k') | testing/buildbot/chromium.fyi.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698