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