1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/tests/mochitest/text/test_general.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,80 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 1.7 + type="text/css"?> 1.8 + 1.9 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.10 + title="Tests: XUL label text interface"> 1.11 + 1.12 + <script type="application/javascript" 1.13 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.14 + <script type="application/javascript" 1.15 + src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> 1.16 + 1.17 + <script type="application/javascript" 1.18 + src="../common.js"></script> 1.19 + <script type="application/javascript" 1.20 + src="../role.js"></script> 1.21 + <script type="application/javascript" 1.22 + src="../text.js"></script> 1.23 + 1.24 + <script type="application/javascript"> 1.25 + <![CDATA[ 1.26 + //////////////////////////////////////////////////////////////////////////// 1.27 + // Testing 1.28 + 1.29 + var gQueue = null; 1.30 + function doTests() 1.31 + { 1.32 + ////////////////////////////////////////////////////////////////////////// 1.33 + // XUL label 1.34 + 1.35 + var ids = ["label1", "label2"]; 1.36 + 1.37 + testCharacterCount(ids, 5); 1.38 + 1.39 + testText(ids, 0, -1, "Hello"); 1.40 + testText(ids, 0, 1, "H"); 1.41 + 1.42 + testCharAfterOffset(ids, 0, "e", 1, 2); 1.43 + testCharBeforeOffset(ids, 1, "H", 0, 1); 1.44 + testCharAtOffset(ids, 1, "e", 1, 2); 1.45 + 1.46 + ////////////////////////////////////////////////////////////////////////// 1.47 + // XUL textbox 1.48 + 1.49 + testTextAtOffset([ getNode("tbox1").inputField ], BOUNDARY_LINE_START, 1.50 + [ [ 0, 4, "test", 0, 4 ] ]); 1.51 + 1.52 + SimpleTest.finish(); 1.53 + } 1.54 + 1.55 + SimpleTest.waitForExplicitFinish(); 1.56 + addA11yLoadEvent(doTests); 1.57 + ]]> 1.58 + </script> 1.59 + 1.60 + <vbox flex="1" style="overflow: auto;"> 1.61 + <body xmlns="http://www.w3.org/1999/xhtml"> 1.62 + <a target="_blank" 1.63 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=396166" 1.64 + title="xul:label@value accessible should implement nsIAccessibleText"> 1.65 + Bug 396166 1.66 + </a> 1.67 + <a target="_blank" 1.68 + href="https://bugzilla.mozilla.org/show_bug.cgi?id=899433" 1.69 + title="Accessibility returns empty line for last line in certain cases"> 1.70 + Bug 899433 1.71 + </a> 1.72 + <p id="display"></p> 1.73 + <div id="content" style="display: none"> 1.74 + </div> 1.75 + <pre id="test"> 1.76 + </pre> 1.77 + </body> 1.78 + <label id="label1" value="Hello"/> 1.79 + <label id="label2">Hello</label> 1.80 + 1.81 + <textbox id="tbox1" value="test" multiline="true"/> 1.82 + </vbox> 1.83 +</window>