dom/base/test/test_writable-replaceable.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 **/
    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");';
    28   return Function(code);
    29 }
    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 });
    45 </script>
    46 </pre>
    47 </body>
    48 </html>

mercurial