Index: LayoutTests/fast/forms/label/continous-click-on-label.html |
diff --git a/LayoutTests/fast/forms/label/continous-click-on-label.html b/LayoutTests/fast/forms/label/continous-click-on-label.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ae32eccaea6c2842c4c6c1aede19d8107cbaa552 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/label/continous-click-on-label.html |
@@ -0,0 +1,45 @@ |
+<!DOCTYPE html> |
+<html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+span { |
+ display: inline-block; |
+ width: 15px; |
+ height: 15px; |
+ vertical-align: bottom; |
+ border: 1px solid #ccc; |
+ margin-right: 5px; |
+ background-color: #fff; |
+} |
+</style> |
+ |
+<label><input type="checkbox" id="checkbox"><span id="span"></span></label> |
+ |
+<script> |
+description('Test the continous checking and unchecking of checkbox when ' + |
+ 'clicking on associated label'); |
+ |
+var checkbox = document.getElementById('checkbox'); |
+var span = document.getElementById('span'); |
+ |
+// intially unchecked |
tkent
2014/09/16 01:53:37
The comment should be replaced with code:
shou
deepak.sa
2014/09/16 10:31:15
Done.
|
+// after 3 clicks it should be checked |
tkent
2014/09/16 01:53:37
This comment should be shown in the test result:
deepak.sa
2014/09/16 10:31:16
Done.
|
+testWithContinousClick(span, 3); |
+shouldBeTrue('checkbox.checked'); |
+ |
+// As checkbox is checked, after 10 clicks it will be checked. |
tkent
2014/09/16 01:53:37
Ditto.
deepak.sa
2014/09/16 10:31:16
Done.
|
+testWithContinousClick(span, 10); |
+shouldBeTrue('checkbox.checked'); |
+ |
+checkbox.style.display = 'none'; |
+ |
+function testWithContinousClick(element, number) |
+{ |
+ eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop); |
+ for (n = 0; n < number; ++n) { |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ } |
+} |
+</script> |
+</html> |