|
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="Tests: XUL label text interface"> |
|
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"></script> |
|
13 |
|
14 <script type="application/javascript" |
|
15 src="../common.js"></script> |
|
16 <script type="application/javascript" |
|
17 src="../role.js"></script> |
|
18 <script type="application/javascript" |
|
19 src="../text.js"></script> |
|
20 |
|
21 <script type="application/javascript"> |
|
22 <![CDATA[ |
|
23 //////////////////////////////////////////////////////////////////////////// |
|
24 // Testing |
|
25 |
|
26 var gQueue = null; |
|
27 function doTests() |
|
28 { |
|
29 ////////////////////////////////////////////////////////////////////////// |
|
30 // XUL label |
|
31 |
|
32 var ids = ["label1", "label2"]; |
|
33 |
|
34 testCharacterCount(ids, 5); |
|
35 |
|
36 testText(ids, 0, -1, "Hello"); |
|
37 testText(ids, 0, 1, "H"); |
|
38 |
|
39 testCharAfterOffset(ids, 0, "e", 1, 2); |
|
40 testCharBeforeOffset(ids, 1, "H", 0, 1); |
|
41 testCharAtOffset(ids, 1, "e", 1, 2); |
|
42 |
|
43 ////////////////////////////////////////////////////////////////////////// |
|
44 // XUL textbox |
|
45 |
|
46 testTextAtOffset([ getNode("tbox1").inputField ], BOUNDARY_LINE_START, |
|
47 [ [ 0, 4, "test", 0, 4 ] ]); |
|
48 |
|
49 SimpleTest.finish(); |
|
50 } |
|
51 |
|
52 SimpleTest.waitForExplicitFinish(); |
|
53 addA11yLoadEvent(doTests); |
|
54 ]]> |
|
55 </script> |
|
56 |
|
57 <vbox flex="1" style="overflow: auto;"> |
|
58 <body xmlns="http://www.w3.org/1999/xhtml"> |
|
59 <a target="_blank" |
|
60 href="https://bugzilla.mozilla.org/show_bug.cgi?id=396166" |
|
61 title="xul:label@value accessible should implement nsIAccessibleText"> |
|
62 Bug 396166 |
|
63 </a> |
|
64 <a target="_blank" |
|
65 href="https://bugzilla.mozilla.org/show_bug.cgi?id=899433" |
|
66 title="Accessibility returns empty line for last line in certain cases"> |
|
67 Bug 899433 |
|
68 </a> |
|
69 <p id="display"></p> |
|
70 <div id="content" style="display: none"> |
|
71 </div> |
|
72 <pre id="test"> |
|
73 </pre> |
|
74 </body> |
|
75 <label id="label1" value="Hello"/> |
|
76 <label id="label2">Hello</label> |
|
77 |
|
78 <textbox id="tbox1" value="test" multiline="true"/> |
|
79 </vbox> |
|
80 </window> |