3 <script src=
"../../../resources/js-test.js"></script>
9 vertical-align: bottom;
10 border:
1px solid #ccc;
12 background-color: #fff;
16 <label><input type=
"checkbox" id=
"checkbox"><span id=
"span"></span></label>
19 description('Test the continous checking and unchecking of checkbox when ' +
20 'clicking on associated label');
22 var checkbox
= document
.getElementById('checkbox');
23 var span
= document
.getElementById('span');
25 shouldBeFalse('checkbox.checked');
26 debug('The checkbox should be checked after three clicks');
27 testWithContinousClick(span
, 3);
28 shouldBeTrue('checkbox.checked');
30 debug('Checkbox should still be checked after ten clicks');
31 testWithContinousClick(span
, 10);
32 shouldBeTrue('checkbox.checked');
34 checkbox
.style
.display
= 'none';
36 function testWithContinousClick(element
, number
)
38 eventSender
.mouseMoveTo(element
.offsetLeft
, element
.offsetTop
);
39 for (n
= 0; n
< number
; ++n
) {
40 eventSender
.mouseDown();
41 eventSender
.mouseUp();