dom/tests/mochitest/bugs/file_bug504862.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 <html>
michael@0 2 <body>
michael@0 3 <script>
michael@0 4 window.returnValue = 3;
michael@0 5
michael@0 6 if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
michael@0 7 // Test that we got the right arguments.
michael@0 8 opener.is(window.dialogArguments, "my args",
michael@0 9 "dialog did not get the right arguments.");
michael@0 10
michael@0 11 // Load a different url, and test that it sees the arguments (since it's same origin).
michael@0 12 window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';";
michael@0 13 } else {
michael@0 14 // Post a message containing our arguments to the opener to test
michael@0 15 // that this cross origing dialog does *not* see the passed in
michael@0 16 // arguments.
michael@0 17 opener.postMessage("args: " + window.dialogArguments,
michael@0 18 "http://mochi.test:8888");
michael@0 19
michael@0 20 close();
michael@0 21 }
michael@0 22 </script>

mercurial