dom/base/test/test_writable-replaceable.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial