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

Unified 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: Code review comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/onchange-js-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/onchange-js.html
diff --git a/LayoutTests/fast/events/onchange-js.html b/LayoutTests/fast/events/onchange-js.html
new file mode 100644
index 0000000000000000000000000000000000000000..1478587220a750e33c13271009d309143a6e1db6
--- /dev/null
+++ b/LayoutTests/fast/events/onchange-js.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<input id="input" type="text" onchange="changeHandler()">
+<script>
+description('This test verifies that the change event is fired, when value is changed in change event handler.');
+var input = document.getElementById('input');
+var changeEventCounter = 0;
+function changeHandler()
+{
+ changeEventCounter++;
+ input.value = '';
+}
+
+input.focus();
+document.execCommand('InsertText', false, 'foo bar baz');
+shouldBeEqualToString('input.value', 'foo bar baz');
+input.blur();
+shouldBe('changeEventCounter', '1');
+shouldBeEqualToString('input.value', '');
+
+input.focus();
+document.execCommand('InsertText', false, 'foo bar baz');
+shouldBeEqualToString('input.value', 'foo bar baz');
+input.blur();
+shouldBe('changeEventCounter', '2');
+</script>
+</body>
+</html>
« 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