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

Side by Side 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: Without static variables 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <script src="../../../resources/js-test.js"></script>
4 <style>
5 span {
6 display: inline-block;
7 width: 15px;
8 height: 15px;
9 vertical-align: bottom;
10 border: 1px solid #ccc;
11 margin-right: 5px;
12 background-color: #fff;
13 }
14 </style>
15
16 <label><input type="checkbox" id="checkbox"><span id="span"></span></label>
17
18 <script>
19 description('Test the continous checking and unchecking of checkbox when ' +
20 'clicking on associated label');
21
22 var checkbox = document.getElementById('checkbox');
23 var span = document.getElementById('span');
24
25 // 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.
26 // 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.
27 testWithContinousClick(span, 3);
28 shouldBeTrue('checkbox.checked');
29
30 // 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.
31 testWithContinousClick(span, 10);
32 shouldBeTrue('checkbox.checked');
33
34 checkbox.style.display = 'none';
35
36 function testWithContinousClick(element, number)
37 {
38 eventSender.mouseMoveTo(element.offsetLeft, element.offsetTop);
39 for (n = 0; n < number; ++n) {
40 eventSender.mouseDown();
41 eventSender.mouseUp();
42 }
43 }
44 </script>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698