summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/bugs/file_bug504862.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/mochitest/bugs/file_bug504862.html')
-rw-r--r--dom/tests/mochitest/bugs/file_bug504862.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/dom/tests/mochitest/bugs/file_bug504862.html b/dom/tests/mochitest/bugs/file_bug504862.html
new file mode 100644
index 000000000..dc11ced6f
--- /dev/null
+++ b/dom/tests/mochitest/bugs/file_bug504862.html
@@ -0,0 +1,22 @@
+<html>
+<body>
+<script>
+window.returnValue = 3;
+
+if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
+ // Test that we got the right arguments.
+ opener.is(window.dialogArguments, "my args",
+ "dialog did not get the right arguments.");
+
+ // Load a different url, and test that it sees the arguments (since it's same origin).
+ window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';";
+} else {
+ // Post a message containing our arguments to the opener to test
+ // that this cross origing dialog does *not* see the passed in
+ // arguments.
+ opener.postMessage("args: " + window.dialogArguments,
+ "http://mochi.test:8888");
+
+ close();
+}
+</script>