dom/tests/mochitest/dom-level0/test_crossdomainprops.html
author Nils Maier <maierman@web.de>
Wed, 28 Nov 2012 13:13:13 -0500
changeset 114378 0e5ca55005ae8ef9002ac12472740104fb79fd47
parent 74346 95496a360748609134a5c666d57c7f48aa23393e
child 469641 ba6f655fd68963530c866d0d4a48c3db3d307777
permissions -rw-r--r--
Bug 719180: Part 2 - Add jar channel unit tests; r=taras

<!DOCTYPE HTML>
<html>
<head>
  <title>Test for Cross domain access to properties</title>
  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>        
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="runTest()">
<p id="display"></p>
<div id="content" style="display: none">
  
</div>
<iframe name="frame1" src="file_crossdomainprops_inner.html"></iframe>
<iframe name="frame2" src="http://example.com/tests/dom/tests/mochitest/dom-level0/file_crossdomainprops_inner.html"></iframe>
<pre id="test">
<script class="testbody" type="text/javascript">

SimpleTest.waitForExplicitFinish();

function runTest() {
  ok(frames.frame1.myVar == 10, "access same domain inner window variable");
  var otherDomainVar = null;
  try {
    otherDomainVar = frames.frame2.myVar;
  }
  catch (e) {
    otherDomainVar = -1;
  }
  is(otherDomainVar, -1, "access other domain inner window variable");
  SimpleTest.finish();
}

</script>
</pre>
</body>
</html>