accessible/tests/mochitest/text/test_general.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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"?>
     6 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     7         title="Tests: XUL label text interface">
     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>
    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>
    21   <script type="application/javascript">
    22   <![CDATA[
    23     ////////////////////////////////////////////////////////////////////////////
    24     // Testing
    26     var gQueue = null;
    27     function doTests()
    28     {
    29       //////////////////////////////////////////////////////////////////////////
    30       // XUL label
    32       var ids = ["label1", "label2"];
    34       testCharacterCount(ids, 5);
    36       testText(ids, 0, -1, "Hello");
    37       testText(ids, 0, 1, "H");
    39       testCharAfterOffset(ids, 0, "e", 1, 2);
    40       testCharBeforeOffset(ids, 1, "H", 0, 1);
    41       testCharAtOffset(ids, 1, "e", 1, 2);
    43       //////////////////////////////////////////////////////////////////////////
    44       // XUL textbox
    46       testTextAtOffset([ getNode("tbox1").inputField ], BOUNDARY_LINE_START,
    47                        [ [ 0, 4, "test", 0, 4 ] ]);
    49       SimpleTest.finish();
    50     }
    52     SimpleTest.waitForExplicitFinish();
    53     addA11yLoadEvent(doTests);
    54   ]]>
    55   </script>
    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>
    78   <textbox id="tbox1" value="test" multiline="true"/>
    79   </vbox>
    80 </window>

mercurial