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