Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: LayoutTests/fast/forms/label/continous-click-on-label.html

Issue 556813002: Fix behavior of label associated with control element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..620fe4fdd7899daef2d06cea2b108dee1b9d2f77
--- /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');
+
+shouldBeFalse('checkbox.checked');
+debug('The checkbox should be checked after three clicks');
+testWithContinousClick(span, 3);
+shouldBeTrue('checkbox.checked');
+
+debug('Checkbox should still be checked after ten clicks');
+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>

Powered by Google App Engine
This is Rietveld 408576698