|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="UTF-8"> |
|
5 <title>Test for Bug 823283</title> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
8 </head> |
|
9 <body> |
|
10 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=823283">Mozilla Bug 823283</a> |
|
11 <p id="display"></p> |
|
12 <div id="content" style="display: none"></div> |
|
13 <pre id="test"> |
|
14 <script type="application/javascript"> |
|
15 /** Test for Bug 823283 **/ |
|
16 |
|
17 function createTest(prop, typeStr, valCode) |
|
18 { |
|
19 var code = |
|
20 'is(typeof ' + prop + ', "' + typeStr + '", "' + prop + ': bad unqualified before-state");\n' + |
|
21 'is(typeof window.' + prop + ', "' + typeStr + '", "' + prop + ': bad qualified before-state");\n' + |
|
22 '\n' + |
|
23 prop + ' = ' + valCode + ';\n' + |
|
24 '\n' + |
|
25 'is(typeof ' + prop + ', "' + typeStr + '", "' + prop + ': bad unqualified after-state");\n' + |
|
26 'is(typeof window.' + prop + ', "' + typeStr + '", "' + prop + ': bad qualified after-state");'; |
|
27 |
|
28 return Function(code); |
|
29 } |
|
30 |
|
31 [ |
|
32 ["innerHeight", "number", '"123"'], |
|
33 ["innerWidth", "number", '"456"'], |
|
34 ["outerHeight", "number", '"654"'], |
|
35 ["outerWidth", "number", '"321"'], |
|
36 ["screenX", "number", '"17"'], |
|
37 ["screenY", "number", '"42"'], |
|
38 ["status", "string", '{}'], |
|
39 ["name", "string", '{}'], |
|
40 ].forEach(function(args) |
|
41 { |
|
42 createTest.apply(null, args)(); |
|
43 }); |
|
44 |
|
45 </script> |
|
46 </pre> |
|
47 </body> |
|
48 </html> |