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

Side by Side Diff: LayoutTests/fast/forms/resources/common-spinbutton-change-and-input-events.js

Issue 128153002: Update of change event for datetime input type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added keyboard change event Created 6 years, 11 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
1 var inputEventCounter = 0; 1 var inputEventCounter = 0;
2 var changeEventCounter = 0; 2 var changeEventCounter = 0;
3 var testInput; 3 var testInput;
4 4
5 function testSpinButtonChangeAndInputEvents(inputType, initialValue, expectedVal ue, maximumValue) 5 function testSpinButtonChangeAndInputEvents(inputType, initialValue, expectedVal ue, maximumValue)
6 { 6 {
7 description('Test for event dispatching by spin buttons in a type=' + inputT ype + ' input.'); 7 description('Test for event dispatching by spin buttons in a type=' + inputT ype + ' input.');
8 if (!window.eventSender) { 8 if (!window.eventSender) {
9 debug('No eventSender'); 9 debug('No eventSender');
10 return; 10 return;
(...skipping 16 matching lines...) Expand all
27 eventSender.mouseMoveTo(0, 0); 27 eventSender.mouseMoveTo(0, 0);
28 shouldEvaluateTo('changeEventCounter', 0); 28 shouldEvaluateTo('changeEventCounter', 0);
29 shouldEvaluateTo('inputEventCounter', 0); 29 shouldEvaluateTo('inputEventCounter', 0);
30 testInput.focus(); 30 testInput.focus();
31 31
32 debug('Click the upper button'); 32 debug('Click the upper button');
33 // Move the cursor on the upper button. 33 // Move the cursor on the upper button.
34 var spinButton = getElementByPseudoId(internals.oldestShadowRoot(testInput), "-webkit-inner-spin-button"); 34 var spinButton = getElementByPseudoId(internals.oldestShadowRoot(testInput), "-webkit-inner-spin-button");
35 eventSender.mouseMoveTo(testInput.offsetLeft + spinButton.offsetLeft, testIn put.offsetTop + testInput.offsetHeight / 4); 35 eventSender.mouseMoveTo(testInput.offsetLeft + spinButton.offsetLeft, testIn put.offsetTop + testInput.offsetHeight / 4);
36 eventSender.mouseDown(); 36 eventSender.mouseDown();
37 debug('Triggers only input event');
38 shouldBeEqualToString('testInput.value', expectedValue);
39 shouldEvaluateTo('changeEventCounter', 0);
40 shouldEvaluateTo('inputEventCounter', 1);
41 debug('Triggers only change event');
37 eventSender.mouseUp(); 42 eventSender.mouseUp();
38 shouldBeEqualToString('testInput.value', expectedValue);
39 shouldEvaluateTo('changeEventCounter', 1); 43 shouldEvaluateTo('changeEventCounter', 1);
40 shouldEvaluateTo('inputEventCounter', 1); 44 shouldEvaluateTo('inputEventCounter', 1);
41 45
42 if (testInput.hasAttribute("max")) { 46 if (testInput.hasAttribute("max")) {
43 debug('Click again, but the value is not changed.'); 47 debug('Click again, but the value is not changed.');
44 eventSender.mouseDown(); 48 eventSender.mouseDown();
45 eventSender.mouseUp(); 49 eventSender.mouseUp();
46 shouldBeEqualToString('testInput.value', expectedValue); 50 shouldBeEqualToString('testInput.value', expectedValue);
47 shouldEvaluateTo('changeEventCounter', 1); 51 shouldEvaluateTo('changeEventCounter', 1);
48 shouldEvaluateTo('inputEventCounter', 1); 52 shouldEvaluateTo('inputEventCounter', 1);
49 } 53 }
50 54
51 debug('Focus on another field'); 55 debug('Focus on another field');
52 anotherInput.focus(); 56 anotherInput.focus();
53 shouldEvaluateTo('changeEventCounter', 1); 57 shouldEvaluateTo('changeEventCounter', 1);
54 shouldEvaluateTo('inputEventCounter', 1); 58 shouldEvaluateTo('inputEventCounter', 1);
55 59
56 parent.innerHTML = ''; 60 parent.innerHTML = '';
57 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698