|
1 <?xml version="1.0"?> |
|
2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?> |
|
3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" |
|
4 type="text/css"?> |
|
5 |
|
6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" |
|
7 title="Caret move event testing"> |
|
8 |
|
9 <script type="application/javascript" |
|
10 src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> |
|
11 <script type="application/javascript" |
|
12 src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/> |
|
13 |
|
14 <script type="application/javascript" |
|
15 src="../common.js" /> |
|
16 <script type="application/javascript" |
|
17 src="../events.js" /> |
|
18 |
|
19 <script type="application/javascript"> |
|
20 /** |
|
21 * Do tests. |
|
22 */ |
|
23 |
|
24 //gA11yEventDumpID = "eventdump"; // debug stuff |
|
25 //gA11yEventDumpToConsole = true; |
|
26 |
|
27 var gQueue = null; |
|
28 |
|
29 function doTests() |
|
30 { |
|
31 if (MAC) { |
|
32 todo(false, "Make these tests pass on OSX (bug 650294)"); |
|
33 SimpleTest.finish(); |
|
34 return; |
|
35 } |
|
36 |
|
37 gQueue = new eventQueue(EVENT_TEXT_CARET_MOVED); |
|
38 |
|
39 var id = "textbox"; |
|
40 var input = getNode(id).inputField; |
|
41 gQueue.push(new synthFocus(id, new caretMoveChecker(5, input))); |
|
42 gQueue.push(new synthSelectAll(id, new caretMoveChecker(5, input))); |
|
43 gQueue.push(new synthHomeKey(id, new caretMoveChecker(0, input))); |
|
44 gQueue.push(new synthRightKey(id, new caretMoveChecker(1, input))); |
|
45 |
|
46 gQueue.invoke(); // Will call SimpleTest.finish(); |
|
47 } |
|
48 |
|
49 SimpleTest.waitForExplicitFinish(); |
|
50 addA11yLoadEvent(doTests); |
|
51 </script> |
|
52 |
|
53 <hbox flex="1" style="overflow: auto;"> |
|
54 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
55 <a target="_blank" |
|
56 href="https://bugzilla.mozilla.org/show_bug.cgi?id=634240" |
|
57 title="No caret move events are fired for XUL textbox accessible"> |
|
58 Mozilla Bug 634240 |
|
59 </a> |
|
60 <p id="display"></p> |
|
61 <div id="content" style="display: none"></div> |
|
62 <pre id="test"> |
|
63 </pre> |
|
64 </body> |
|
65 |
|
66 <vbox flex="1"> |
|
67 <textbox id="textbox" value="hello"/> |
|
68 |
|
69 <vbox id="eventdump"/> |
|
70 </vbox> |
|
71 </hbox> |
|
72 </window> |