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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html

Issue 2151353002: [InputEvent] Replace |EditAction| with |InputType| (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@inputevent-text-styling
Patch Set: Replaced |EditAction| with |InputType| Created 4 years, 5 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: third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
index af1fac5888379a0a4289c2417394ec6fbbcf00de..7377cf99d5d3e412012beb49684293fd46d27227 100644
--- a/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
+++ b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
@@ -25,12 +25,13 @@ test(function() {
if (!window.eventSender) {
document.write('This test requires eventSender');
} else {
- var kNoInputEventFired = 'noInputEventFired';
- function testKeyDownInputType(key, modifiers, inputType) {
- lastBeforeInputType = kNoInputEventFired;
- lastInputType = kNoInputEventFired;
+ const NO_INPUT_EVENT_FIRED = 'NO_INPUT_EVENT_FIRED';
+ function testKeyDownInputType(key, modifiers, beforeInputType, inputType) {
+ inputType = inputType || beforeInputType;
+ lastBeforeInputType = NO_INPUT_EVENT_FIRED;
+ lastInputType = NO_INPUT_EVENT_FIRED;
eventSender.keyDown(key, modifiers);
- assert_equals(lastBeforeInputType, inputType, `${modifiers.toString()}+${key} should produce beforeInputType: ${inputType}`);
+ assert_equals(lastBeforeInputType, beforeInputType, `${modifiers.toString()}+${key} should produce beforeInputType: ${inputType}`);
assert_equals(lastInputType, inputType, `${modifiers.toString()}+${key} should produce inputType: ${inputType}`);
}
@@ -38,9 +39,12 @@ test(function() {
// Typing
testKeyDownInputType('a', [], 'insertText');
testKeyDownInputType('6', [], 'insertText');
- testKeyDownInputType('Backspace', [], 'deleteContent');
+ testKeyDownInputType('Backspace', [], 'deleteContentBackward');
testKeyDownInputType('l', ['shiftKey'], 'insertText');
testKeyDownInputType('w', ['shiftKey'], 'insertText');
+ // TODO(chongz): Add tests for Enter key on <textarea> and ContentEditable.
+ testKeyDownInputType('Enter', [], 'insertLineBreak', NO_INPUT_EVENT_FIRED);
+ testKeyDownInputType('Enter', ['shiftKey'], 'insertLineBreak', NO_INPUT_EVENT_FIRED);
// Keyboard commands
var isMacOS = (navigator.userAgent.indexOf('Mac OS X') != -1);
@@ -50,9 +54,9 @@ test(function() {
testKeyDownInputType('z', ['ctrlKey', 'shiftKey'], 'redo');
}
// Move command should not generate input events.
- testKeyDownInputType('ArrowLeft', [], kNoInputEventFired);
- testKeyDownInputType('ArrowLeft', ['shiftKey'], kNoInputEventFired);
- testKeyDownInputType('Home', [], kNoInputEventFired);
+ testKeyDownInputType('ArrowLeft', [], NO_INPUT_EVENT_FIRED);
+ testKeyDownInputType('ArrowLeft', ['shiftKey'], NO_INPUT_EVENT_FIRED);
+ testKeyDownInputType('Home', [], NO_INPUT_EVENT_FIRED);
}
}, 'Testing beforeinput inputType');
</script>

Powered by Google App Engine
This is Rietveld 408576698