test_bug704049.html (1520B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=704049 5 --> 6 <head> 7 <title>Test for Bug 704049</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=704049">Mozilla Bug 704049</a> 14 <p id="display"></p> 15 <input type="radio" id="radio11" name="group1"> 16 <input type="radio" id="radio12" name="group1"> 17 <input type="radio" id="radio21" name="group2" checked> 18 <input type="radio" id="radio22" name="group2"> 19 <pre id="test"> 20 <script type="application/javascript"> 21 22 /** Test for Bug 704049 */ 23 24 window.addEventListener("click", function (e) { e.preventDefault(); }); 25 26 function doTest() 27 { 28 var target = document.getElementById("radio11"); 29 synthesizeMouseAtCenter(target, {}); 30 is(target.checked, false, "radio11 is checked"); 31 target = document.getElementById("radio12"); 32 synthesizeMouseAtCenter(target, {}); 33 is(target.checked, false, "radio12 is checked"); 34 target = document.getElementById("radio21"); 35 synthesizeMouseAtCenter(target, {}); 36 is(target.checked, true, "radio21 is not checked"); 37 target = document.getElementById("radio22"); 38 synthesizeMouseAtCenter(target, {}); 39 is(target.checked, false, "radio22 is checked"); 40 41 SimpleTest.finish(); 42 } 43 44 SimpleTest.waitForExplicitFinish(); 45 SimpleTest.waitForFocus(doTest); 46 47 </script> 48 </pre> 49 </body> 50 </html>