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

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: 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 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..02e34f439c009318a88767ded4adf679a8073c77
--- /dev/null
+++ b/LayoutTests/fast/events/onchange-js.html
@@ -0,0 +1,35 @@
+<!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 = "";
keishi 2014/06/05 09:42:02 nit: only place using double quotes
Habib Virji 2014/06/05 10:18:14 Done.
+}
+
+if (window.testRunner)
+ 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.
+
+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