4 https://bugzilla.mozilla.org/show_bug.cgi?id=625452
7 <title>Test for Bug
625452</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/EventUtils.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=625452">Mozilla Bug
625452</a>
19 <script type=
"application/javascript">
21 /** Test for Bug
625452 **/
22 SimpleTest.waitForExplicitFinish();
23 addLoadEvent(function() {
24 var i = document.querySelector(
"input");
26 i.addEventListener(
"input", function() { inputCount++; });
33 synthesizeKey(
"X", {accelKey: true});
34 is(i.value,
"bar",
"Cut should work correctly");
35 is(inputCount,
1,
"input event should be raised correctly");
38 synthesizeKey(
"Z", {accelKey: true});
39 is(i.value,
"foo bar",
"Undo should work correctly");
40 is(inputCount,
2,
"input event should be raised correctly");
43 synthesizeKey(
"Z", {accelKey: true, shiftKey: true});
44 is(i.value,
"bar",
"Redo should work correctly");
45 is(inputCount,
3,
"input event should be raised correctly");
50 synthesizeKey(
"KEY_Delete");
51 is(i.value,
"r",
"Delete should work correctly");
52 is(inputCount,
4,
"input event should be raised correctly");
54 // test DeleteSelection(eNone)
55 i.value =
"retest"; // the
"r" common prefix is crucial here
56 is(inputCount,
4,
"input event should not have been raised");
58 // paste is tested in test_bug596001.html