1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/bugs/test_bug817476.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=817476 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 817476</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 +</head> 1.15 +<body> 1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=817476">Mozilla Bug 817476</a> 1.17 +<p id="display"></p> 1.18 +<div id="content" style="display: none"> 1.19 + 1.20 +</div> 1.21 +<pre id="test"> 1.22 +<script type="application/javascript"> 1.23 + 1.24 +/** Test for Bug 817476 **/ 1.25 +function getNewWindow() { 1.26 + var ifr = document.createElement("iframe"); 1.27 + $("content").appendChild(ifr); 1.28 + return ifr.contentWindow; 1.29 +} 1.30 + 1.31 +// Test getting .screen before .Screen 1.32 +var win = getNewWindow(); 1.33 +is(Object.getPrototypeOf(win.screen), win.Screen.prototype, 1.34 + "protos must match (1)"); 1.35 +is(win.Screen.prototype.toString(), "[object ScreenPrototype]", 1.36 + "proto must be WebIDL (1)"); 1.37 + 1.38 +// Test getting Screen before .screen 1.39 +var win = getNewWindow(); 1.40 +is(win.Screen.prototype, Object.getPrototypeOf(win.screen), 1.41 + "protos must match (2)"); 1.42 +is(win.Screen.prototype.toString(), "[object ScreenPrototype]", 1.43 + "proto must be WebIDL (2)"); 1.44 + 1.45 +</script> 1.46 +</pre> 1.47 +</body> 1.48 +</html>