test_bug817476.html (1211B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=817476 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 817476</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=817476">Mozilla Bug 817476</a> 14 <p id="display"></p> 15 <div id="content" style="display: none"> 16 17 </div> 18 <pre id="test"> 19 <script type="application/javascript"> 20 21 /** Test for Bug 817476 */ 22 function getNewWindow() { 23 var ifr = document.createElement("iframe"); 24 $("content").appendChild(ifr); 25 return ifr.contentWindow; 26 } 27 28 // Test getting .screen before .Screen 29 var win = getNewWindow(); 30 is(Object.getPrototypeOf(win.screen), win.Screen.prototype, 31 "protos must match (1)"); 32 is(win.Screen.prototype.toString(), "[object Screen]", 33 "proto must be WebIDL (1)"); 34 35 // Test getting Screen before .screen 36 var win = getNewWindow(); 37 is(win.Screen.prototype, Object.getPrototypeOf(win.screen), 38 "protos must match (2)"); 39 is(win.Screen.prototype.toString(), "[object Screen]", 40 "proto must be WebIDL (2)"); 41 42 </script> 43 </pre> 44 </body> 45 </html>