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

Side by Side Diff: LayoutTests/fast/events/onchange-js.html

Issue 313013005: Set value of m_textAsOfLastFormControlChangeEvent before triggering change event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed test, to check strings output and keep count of change counter Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/onchange-js-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <input id="input" type="text" onchange="changeHandler()">
8 <script>
9 description('This test verifies that the change event is fired, when value is ch anged in change event handler.');
10 var input = document.getElementById('input');
11 var changeEventCounter = 0;
12 function changeHandler()
13 {
14 changeEventCounter++;
15 input.value = "";
keishi 2014/06/05 09:42:02 nit: only place using double quotes
Habib Virji 2014/06/05 10:18:14 Done.
16 }
17
18 if (window.testRunner)
19 testRunner.dumpAsText();
keishi 2014/06/05 09:42:02 nit: dumpAsText is called in js-test.js so you can
Habib Virji 2014/06/05 10:18:14 Done.
20
21 input.focus();
22 document.execCommand('InsertText', false, 'foo bar baz');
23 shouldBeEqualToString('input.value', 'foo bar baz');
24 input.blur();
25 shouldBe('changeEventCounter', '1');
26 shouldBeEqualToString('input.value', '');
27
28 input.focus();
29 document.execCommand('InsertText', false, 'foo bar baz');
30 shouldBeEqualToString('input.value', 'foo bar baz');
31 input.blur();
32 shouldBe('changeEventCounter', '2');
33 </script>
34 </body>
35 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/onchange-js-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698