dom/tests/mochitest/bugs/test_bug633133.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/tests/mochitest/bugs/test_bug633133.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=633133
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 633133</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.13 +</head>
    1.14 +<body>
    1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=633133">Mozilla Bug 633133</a>
    1.16 +<p id="display"></p>
    1.17 +<div id="content" style="display: none">
    1.18 +  <div id='foo'></div>
    1.19 +  <div name='bar'></div>
    1.20 +  <select id="select" onchange="var foo = 'bar';">
    1.21 +    <option>option1</option>
    1.22 +    <option>option2</option>
    1.23 +  </select>
    1.24 +</div>
    1.25 +<pre id="test">
    1.26 +<script type="application/javascript">
    1.27 +
    1.28 +/** Test for Bug 633133 **/
    1.29 +
    1.30 +var divCollection = document.getElementsByTagName('div');
    1.31 +
    1.32 +ok("foo" in divCollection, "'foo' should be in the div collection");
    1.33 +ok("bar" in divCollection, "'bar' should be in the div collection");
    1.34 +ok(!("" in divCollection), "empty string shouldn't be in the div collection");
    1.35 +ok(!("foobar" in divCollection), "'foobar' shouldn't be in the div collection");
    1.36 +
    1.37 +var select = $('select');
    1.38 +is(select[0].text, "option1", "select elements work");
    1.39 +Math.sin();
    1.40 +ok(1 in select, "in works");
    1.41 +is(select[1].text, "option2", "can get it too");
    1.42 +ok(!(2 in select), "in works for elements out of range");
    1.43 +is(select[2], undefined, "can get them too and they're undefined");
    1.44 +isnot(select.onchange, undefined, "select.onchange shouldn't be undefined");
    1.45 +is(typeof(select.onchange), 'function', "select.onchange should be a function");
    1.46 +
    1.47 +</script>
    1.48 +</pre>
    1.49 +</body>
    1.50 +</html>

mercurial