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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/resources/textarea-input-event.js

Issue 1522803002: Move textarea-related tests to fast/forms/textarea/, part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@color-uaf
Patch Set: Created 5 years 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
(Empty)
1 description('Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=15189">ht tps://bugs.webkit.org/show_bug.cgi?id=15189</a><br>');
2
3 var handleTextareaOnInputCallCount = 0;
4 var handleDivOnInputCallCount = 0;
5 var successfullyParsed = false;
6
7 function handleDivOnInput(e) {
8 if (e.target !== ta) {
9 testFailed('Wrong target');
10 } else {
11 handleDivOnInputCallCount++;
12 shouldBeEqualToString('ta.value', 'x');
13 }
14 }
15
16 function handleTextareaOnInput(e) {
17 if (e.target !== ta) {
18 testFailed('Wrong target');
19 } else {
20 handleTextareaOnInputCallCount++;
21 shouldBeEqualToString('ta.value', 'x');
22 }
23 }
24
25 var ta = document.getElementById('ta');
26 ta.setAttribute('oninput', 'handleTextareaOnInput(event)');
27
28 // Change the value before focusing.
29 ta.value = '';
30
31 ta.focus();
32
33 if (window.eventSender) {
34 eventSender.keyDown('x', []);
35 shouldEvaluateTo('handleTextareaOnInputCallCount', 1);
36 shouldEvaluateTo('handleDivOnInputCallCount', 1);
37
38 // Change programmatically
39 ta.value = 'programmatically';
40
41 // Should not have triggered the events.
42 shouldEvaluateTo('handleTextareaOnInputCallCount', 1);
43 shouldEvaluateTo('handleDivOnInputCallCount', 1);
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698