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

Side by Side Diff: LayoutTests/fast/forms/label/label-event-order.html

Issue 58533003: Move fast/js/resources files to resources. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <body> 2 <body>
3 <script src="../../js/resources/js-test-pre.js"></script> 3 <script src="../../../resources/js-test.js"></script>
4 <label><input type="checkbox">Label for a checkbox</label> 4 <label><input type="checkbox">Label for a checkbox</label>
5 <script> 5 <script>
6 description('Event order for a labeled control should be "focus" then "change"') ; 6 description('Event order for a labeled control should be "focus" then "change"') ;
7 var label = document.querySelector('label'); 7 var label = document.querySelector('label');
8 var checkbox = document.querySelector('input'); 8 var checkbox = document.querySelector('input');
9 var focusCount = 0; 9 var focusCount = 0;
10 var changeCount = 0; 10 var changeCount = 0;
11 checkbox.addEventListener('focus', function() { 11 checkbox.addEventListener('focus', function() {
12 debug('"focus" event has been dispatched.'); 12 debug('"focus" event has been dispatched.');
13 focusCount++; 13 focusCount++;
14 shouldBe('changeCount', '0'); 14 shouldBe('changeCount', '0');
15 }, false); 15 }, false);
16 checkbox.addEventListener('change', function() { 16 checkbox.addEventListener('change', function() {
17 debug('"change" event has been dispatched.'); 17 debug('"change" event has been dispatched.');
18 changeCount++; 18 changeCount++;
19 shouldBe('focusCount', '1'); 19 shouldBe('focusCount', '1');
20 }, false); 20 }, false);
21 label.click(); 21 label.click();
22 label.remove(); 22 label.remove();
23 </script> 23 </script>
24 </body> 24 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698