4 https://bugzilla.mozilla.org/show_bug.cgi?id=862380
8 <title>Test for Bug
862380</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
13 /** Test for Bug
862380 **/
14 SimpleTest.waitForExplicitFinish();
16 checkNotEnumerable($('ifr').contentWindow, true);
17 checkNotEnumerable($('ifr').contentWindow.location, false);
21 function checkNotEnumerable(obj, isWindow) {
23 const expectedWindow = [
"0"];
24 const expectedLocation = [];
25 const expected = isWindow ? expectedWindow : expectedLocation;
26 is(Object.keys(obj).length, expected.length,
27 "Object.keys gives right array length");
31 is(actual.length, expected.length,
32 "Enumeration sees the right number of props");
35 for (var i =
0; i < actual.length; ++i)
36 is(actual[i], expected[i],
"Arrays should be the same " + i);
38 ok(false,
"threw: " + e);
45 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=862380">Mozilla Bug
862380</a>
47 <div id=
"content" style=
"display: none">
50 <iframe id=
"ifr" onload=
"go();" src=
"http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html"></iframe>