layout/forms/test/test_bug704049.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/test/test_bug704049.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=704049
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 704049</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704049">Mozilla Bug 704049</a>
    1.17 +<p id="display"></p>
    1.18 +<input type="radio" id="radio11" name="group1">
    1.19 +<input type="radio" id="radio12" name="group1">
    1.20 +<input type="radio" id="radio21" name="group2" checked>
    1.21 +<input type="radio" id="radio22" name="group2">
    1.22 +<pre id="test">
    1.23 +<script type="application/javascript">
    1.24 +
    1.25 +/** Test for Bug 704049 **/
    1.26 +
    1.27 +window.addEventListener("click", function (e) { e.preventDefault(); }, false);
    1.28 +
    1.29 +function doTest()
    1.30 +{
    1.31 +  var target = document.getElementById("radio11");
    1.32 +  synthesizeMouseAtCenter(target, {});
    1.33 +  is(target.checked, false, "radio11 is checked");
    1.34 +  target = document.getElementById("radio12");
    1.35 +  synthesizeMouseAtCenter(target, {});
    1.36 +  is(target.checked, false, "radio12 is checked");
    1.37 +  target = document.getElementById("radio21");
    1.38 +  synthesizeMouseAtCenter(target, {});
    1.39 +  is(target.checked, true, "radio21 is not checked");
    1.40 +  target = document.getElementById("radio22");
    1.41 +  synthesizeMouseAtCenter(target, {});
    1.42 +  is(target.checked, false, "radio22 is checked");
    1.43 +
    1.44 +  SimpleTest.finish();
    1.45 +}
    1.46 +
    1.47 +SimpleTest.waitForExplicitFinish();
    1.48 +SimpleTest.waitForFocus(doTest);
    1.49 +
    1.50 +</script>
    1.51 +</pre>
    1.52 +</body>
    1.53 +</html>

mercurial