accessible/tests/mochitest/events/test_caretmove.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/events/test_caretmove.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     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="Caret move event testing">
    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"/>
    1.16 +
    1.17 +  <script type="application/javascript"
    1.18 +          src="../common.js" />
    1.19 +  <script type="application/javascript"
    1.20 +          src="../events.js" />
    1.21 +
    1.22 +  <script type="application/javascript">
    1.23 +    /**
    1.24 +     * Do tests.
    1.25 +     */
    1.26 +
    1.27 +    //gA11yEventDumpID = "eventdump"; // debug stuff
    1.28 +    //gA11yEventDumpToConsole = true;
    1.29 +
    1.30 +    var gQueue = null;
    1.31 +
    1.32 +    function doTests()
    1.33 +    {
    1.34 +      if (MAC) {
    1.35 +        todo(false, "Make these tests pass on OSX (bug 650294)");
    1.36 +        SimpleTest.finish();
    1.37 +        return;
    1.38 +      }
    1.39 +
    1.40 +      gQueue = new eventQueue(EVENT_TEXT_CARET_MOVED);
    1.41 +
    1.42 +      var id = "textbox";
    1.43 +      var input = getNode(id).inputField;
    1.44 +      gQueue.push(new synthFocus(id, new caretMoveChecker(5, input)));
    1.45 +      gQueue.push(new synthSelectAll(id, new caretMoveChecker(5, input)));
    1.46 +      gQueue.push(new synthHomeKey(id, new caretMoveChecker(0, input)));
    1.47 +      gQueue.push(new synthRightKey(id, new caretMoveChecker(1, input)));
    1.48 +
    1.49 +      gQueue.invoke(); // Will call SimpleTest.finish();
    1.50 +    }
    1.51 +
    1.52 +    SimpleTest.waitForExplicitFinish();
    1.53 +    addA11yLoadEvent(doTests);
    1.54 +  </script>
    1.55 +
    1.56 +  <hbox flex="1" style="overflow: auto;">
    1.57 +    <body xmlns="http://www.w3.org/1999/xhtml">
    1.58 +      <a target="_blank"
    1.59 +         href="https://bugzilla.mozilla.org/show_bug.cgi?id=634240"
    1.60 +         title="No caret move events are fired for XUL textbox accessible">
    1.61 +        Mozilla Bug 634240
    1.62 +      </a>
    1.63 +      <p id="display"></p>
    1.64 +      <div id="content" style="display: none"></div>
    1.65 +      <pre id="test">
    1.66 +      </pre>
    1.67 +    </body>
    1.68 +
    1.69 +    <vbox flex="1">
    1.70 +      <textbox id="textbox" value="hello"/>
    1.71 +
    1.72 +      <vbox id="eventdump"/>
    1.73 +    </vbox>
    1.74 +  </hbox>
    1.75 +</window>

mercurial