dom/tests/mochitest/bugs/file_bug504862.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/bugs/file_bug504862.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,22 @@
     1.4 +<html>
     1.5 +<body>
     1.6 +<script>
     1.7 +window.returnValue = 3;
     1.8 +
     1.9 +if (location.toString().match(/^http:\/\/mochi.test:8888/)) {
    1.10 +  // Test that we got the right arguments.
    1.11 +  opener.is(window.dialogArguments, "my args",
    1.12 +            "dialog did not get the right arguments.");
    1.13 +
    1.14 +  // Load a different url, and test that it sees the arguments (since it's same origin).
    1.15 +  window.location="data:text/html,<html><body onload=\"opener.is(window.dialogArguments, 'my args', 'subsequent dialog document did not get the right arguments.'); close();\">';";
    1.16 +} else {
    1.17 +  // Post a message containing our arguments to the opener to test
    1.18 +  // that this cross origing dialog does *not* see the passed in
    1.19 +  // arguments.
    1.20 +  opener.postMessage("args: " + window.dialogArguments,
    1.21 +                     "http://mochi.test:8888");
    1.22 +
    1.23 +  close();
    1.24 +}
    1.25 +</script>

mercurial