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

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

Issue 2074423004: [InputEvent] Dispatch 'input' event for ContentEditable and typing on Input element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tkent's review Created 4 years, 6 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/before-input-inputtype.html b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
similarity index 66%
rename from third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-inputtype.html
rename to third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
index 478fa7a7767d33bc272220d0cc7bf2292174fd5b..7c85c9173270bfdd70bed8a8dde2157cac37260b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-inputtype.html
+++ b/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-keyboard.html
@@ -9,18 +9,28 @@
<input type="text" id="txt">
<script>
test(function() {
+ var lastBeforeInputType = '';
var lastInputType = '';
var txt = document.getElementById('txt');
txt.addEventListener('beforeinput', function(event) {
+ assert_true(event instanceof InputEvent);
+ assert_false(event.isComposing);
+ lastBeforeInputType = event.inputType;
+ });
+ txt.addEventListener('input', function(event) {
+ assert_true(event instanceof InputEvent);
+ assert_false(event.isComposing);
lastInputType = event.inputType;
});
if (!window.eventSender) {
document.write('This test requires eventSender');
} else {
- var kNoBeforeInputFired = 'noBeforeInputFired';
+ var kNoInputEventFired = 'noInputEventFired';
function testKeyDownInputType(key, modifiers, inputType) {
- lastInputType = kNoBeforeInputFired;
+ lastBeforeInputType = kNoInputEventFired;
+ lastInputType = kNoInputEventFired;
eventSender.keyDown(key, modifiers);
+ assert_equals(lastBeforeInputType, inputType, `${modifiers.toString()}+${key} should produce beforeInputType: ${inputType}`);
assert_equals(lastInputType, inputType, `${modifiers.toString()}+${key} should produce inputType: ${inputType}`);
}
@@ -40,9 +50,9 @@ test(function() {
testKeyDownInputType('z', ['ctrlKey', 'shiftKey'], 'redo');
}
// Move command should not generate input events.
- testKeyDownInputType('leftArrow', [], kNoBeforeInputFired);
- testKeyDownInputType('leftArrow', ['shiftKey'], kNoBeforeInputFired);
- testKeyDownInputType('home', [], kNoBeforeInputFired);
+ testKeyDownInputType('leftArrow', [], kNoInputEventFired);
+ testKeyDownInputType('leftArrow', ['shiftKey'], kNoInputEventFired);
+ testKeyDownInputType('home', [], kNoInputEventFired);
}
}, 'Testing beforeinput inputType');
</script>

Powered by Google App Engine
This is Rietveld 408576698