dom/base/test/test_writable-replaceable.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/base/test/test_writable-replaceable.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +<!DOCTYPE html>
     1.5 +<html>
     1.6 +<head>
     1.7 +  <meta charset="UTF-8">
     1.8 +  <title>Test for Bug 823283</title>
     1.9 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.10 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.11 +</head>
    1.12 +<body>
    1.13 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=823283">Mozilla Bug 823283</a>
    1.14 +<p id="display"></p>
    1.15 +<div id="content" style="display: none"></div>
    1.16 +<pre id="test">
    1.17 +<script type="application/javascript">
    1.18 +/** Test for Bug 823283 **/
    1.19 +
    1.20 +function createTest(prop, typeStr, valCode)
    1.21 +{
    1.22 +  var code =
    1.23 +    'is(typeof ' + prop + ', "' + typeStr + '", "' + prop + ': bad unqualified before-state");\n' +
    1.24 +    'is(typeof window.' + prop + ', "' + typeStr + '", "' + prop + ': bad qualified before-state");\n' +
    1.25 +    '\n' +
    1.26 +    prop + ' = ' + valCode + ';\n' +
    1.27 +    '\n' +
    1.28 +    'is(typeof ' + prop + ', "' + typeStr + '", "' + prop + ': bad unqualified after-state");\n' +
    1.29 +    'is(typeof window.' + prop + ', "' + typeStr + '", "' + prop + ': bad qualified after-state");';
    1.30 +
    1.31 +  return Function(code);
    1.32 +}
    1.33 +
    1.34 +[
    1.35 +  ["innerHeight", "number", '"123"'],
    1.36 +  ["innerWidth", "number", '"456"'],
    1.37 +  ["outerHeight", "number", '"654"'],
    1.38 +  ["outerWidth", "number", '"321"'],
    1.39 +  ["screenX", "number", '"17"'],
    1.40 +  ["screenY", "number", '"42"'],
    1.41 +  ["status", "string", '{}'],
    1.42 +  ["name", "string", '{}'],
    1.43 +].forEach(function(args)
    1.44 +{
    1.45 +  createTest.apply(null, args)();
    1.46 +});
    1.47 +
    1.48 +</script>
    1.49 +</pre>
    1.50 +</body>
    1.51 +</html>

mercurial