1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/xpconnect/tests/mochitest/test_bug589028.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=589028 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 589028</title> 1.11 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=589028">Mozilla Bug 589028</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 +</div> 1.19 +<pre id="test"> 1.20 +<script> 1.21 + 1.22 +/** Test for Bug 589028 **/ 1.23 +SimpleTest.waitForExplicitFinish(); 1.24 +var p = 0; 1.25 +function go() { 1.26 + var ifr = $('ifr'); 1.27 + var ifrwin = ifr.contentWindow; 1.28 + var ifrdoc = ifr.contentDocument; 1.29 + 1.30 + o1 = new ifrwin.Option(); 1.31 + is(o1.ownerDocument, ifrdoc, "ownerDocument doesn't match iframe"); 1.32 + 1.33 + o2 = ifrwin.getMyOption(); 1.34 + is(o2.ownerDocument, ifrdoc, "ownerDocument doesn't match iframe"); 1.35 + 1.36 + o3 = ifrwin.getCallersOption(this); 1.37 + is(o3.ownerDocument, document); 1.38 + 1.39 + a1 = new ifrwin.Audio(); 1.40 + is(a1.ownerDocument, ifrdoc, "ownerDocument doesn't match iframe"); 1.41 + 1.42 + a2 = ifrwin.getMyAudio(); 1.43 + is(a2.ownerDocument, ifrdoc, "ownerDocument doesn't match iframe"); 1.44 + 1.45 + a3 = ifrwin.getCallersAudio(this); 1.46 + is(a3.ownerDocument, document); 1.47 + 1.48 + i1 = new ifrwin.Image(); 1.49 + is(i1.ownerDocument, ifrdoc, "ownerDocument doesn't match iframe"); 1.50 + 1.51 + i2 = ifrwin.getMyImage(); 1.52 + is(i2.ownerDocument, ifrdoc, "ownerDocument doesn't match iframe"); 1.53 + 1.54 + i3 = ifrwin.getCallersImage(this); 1.55 + is(i3.ownerDocument, document); 1.56 + 1.57 + SimpleTest.finish(); 1.58 +} 1.59 + 1.60 + 1.61 +</script> 1.62 +</pre> 1.63 +<iframe src="bug589028_helper.html" id="ifr" onload="go()"></iframe> 1.64 +</body> 1.65 +</html>