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

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

Issue 159893007: Revert of Update of change event for datetime input type (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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'); 37 eventSender.mouseUp();
38 shouldBeEqualToString('testInput.value', expectedValue); 38 shouldBeEqualToString('testInput.value', expectedValue);
39 shouldEvaluateTo('changeEventCounter', 0);
40 shouldEvaluateTo('inputEventCounter', 1);
41 debug('Triggers only change event');
42 eventSender.mouseUp();
43 shouldEvaluateTo('changeEventCounter', 1); 39 shouldEvaluateTo('changeEventCounter', 1);
44 shouldEvaluateTo('inputEventCounter', 1); 40 shouldEvaluateTo('inputEventCounter', 1);
45 41
46 if (testInput.hasAttribute("max")) { 42 if (testInput.hasAttribute("max")) {
47 debug('Click again, but the value is not changed.'); 43 debug('Click again, but the value is not changed.');
48 eventSender.mouseDown(); 44 eventSender.mouseDown();
49 eventSender.mouseUp(); 45 eventSender.mouseUp();
50 shouldBeEqualToString('testInput.value', expectedValue); 46 shouldBeEqualToString('testInput.value', expectedValue);
51 shouldEvaluateTo('changeEventCounter', 1); 47 shouldEvaluateTo('changeEventCounter', 1);
52 shouldEvaluateTo('inputEventCounter', 1); 48 shouldEvaluateTo('inputEventCounter', 1);
53 } 49 }
54 50
55 debug('Focus on another field'); 51 debug('Focus on another field');
56 anotherInput.focus(); 52 anotherInput.focus();
57 shouldEvaluateTo('changeEventCounter', 1); 53 shouldEvaluateTo('changeEventCounter', 1);
58 shouldEvaluateTo('inputEventCounter', 1); 54 shouldEvaluateTo('inputEventCounter', 1);
59 55
60 parent.innerHTML = ''; 56 parent.innerHTML = '';
61 } 57 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698