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> |