1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/xpconnect/tests/mochitest/test_bug862380.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=862380 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 862380</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 + <script type="application/javascript"> 1.15 + 1.16 + /** Test for Bug 862380 **/ 1.17 + SimpleTest.waitForExplicitFinish(); 1.18 + function go() { 1.19 + checkNotEnumerable($('ifr').contentWindow); 1.20 + checkNotEnumerable($('ifr').contentWindow.location); 1.21 + SimpleTest.finish(); 1.22 + } 1.23 + 1.24 + function checkNotEnumerable(obj) { 1.25 + try { 1.26 + is(Object.getOwnPropertyNames(obj).length, 0, "Object.getOwnPropertyNames gives empty array"); 1.27 + is(Object.keys(obj).length, 0, "Object.keys gives empty array"); 1.28 + for (var i in obj) 1.29 + ok(false, "Enumerated something: " + i); 1.30 + } catch (e) { 1.31 + ok(false, "threw: " + e); 1.32 + } 1.33 + } 1.34 + 1.35 + </script> 1.36 +</head> 1.37 +<body> 1.38 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=862380">Mozilla Bug 862380</a> 1.39 +<p id="display"></p> 1.40 +<div id="content" style="display: none"> 1.41 + 1.42 +</div> 1.43 +<iframe id="ifr" onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe> 1.44 +<pre id="test"> 1.45 +</pre> 1.46 +</body> 1.47 +</html>