accessible/tests/mochitest/events/test_namechange.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/tests/mochitest/events/test_namechange.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,103 @@
     1.4 +<html>
     1.5 +
     1.6 +<head>
     1.7 +  <title>Accessible name change event testing</title>
     1.8 +
     1.9 +  <link rel="stylesheet" type="text/css"
    1.10 +        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    1.11 +
    1.12 +  <script type="application/javascript"
    1.13 +          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    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="../events.js"></script>
    1.21 +  <script type="application/javascript"
    1.22 +          src="../role.js"></script>
    1.23 +  <script type="application/javascript"
    1.24 +          src="../states.js"></script>
    1.25 +
    1.26 +  <script type="application/javascript">
    1.27 +    ////////////////////////////////////////////////////////////////////////////
    1.28 +    // Invokers
    1.29 +
    1.30 +    function setAttr(aID, aAttr, aValue, aChecker)
    1.31 +    {
    1.32 +      this.eventSeq = [ aChecker ];
    1.33 +      this.invoke = function setAttr_invoke()
    1.34 +      {
    1.35 +        getNode(aID).setAttribute(aAttr, aValue);
    1.36 +      }
    1.37 +
    1.38 +      this.getID = function setAttr_getID()
    1.39 +      {
    1.40 +        return "set attr '" + aAttr + "', value '" + aValue + "'";
    1.41 +      }
    1.42 +    }
    1.43 +
    1.44 +    ////////////////////////////////////////////////////////////////////////////
    1.45 +    // Do tests
    1.46 +
    1.47 +    //gA11yEventDumpToConsole = true; // debuggin
    1.48 +
    1.49 +    var gQueue = null;
    1.50 +    function doTests()
    1.51 +    {
    1.52 +      gQueue = new eventQueue();
    1.53 +
    1.54 +      gQueue.push(new setAttr("tst1", "aria-label", "hi",
    1.55 +                              new invokerChecker(EVENT_NAME_CHANGE, "tst1")));
    1.56 +      gQueue.push(new setAttr("tst1", "aria-labelledby", "display",
    1.57 +                              new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
    1.58 +      gQueue.push(new setAttr("tst1", "alt", "alt",
    1.59 +                              new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
    1.60 +      gQueue.push(new setAttr("tst1", "title", "title",
    1.61 +                              new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
    1.62 +
    1.63 +      gQueue.push(new setAttr("tst2", "aria-labelledby", "display",
    1.64 +                              new invokerChecker(EVENT_NAME_CHANGE, "tst2")));
    1.65 +      gQueue.push(new setAttr("tst2", "alt", "alt",
    1.66 +                              new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst2")));
    1.67 +      gQueue.push(new setAttr("tst2", "title", "title",
    1.68 +                              new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst2")));
    1.69 +
    1.70 +      gQueue.push(new setAttr("tst3", "alt", "alt",
    1.71 +                              new invokerChecker(EVENT_NAME_CHANGE, "tst3")));
    1.72 +      gQueue.push(new setAttr("tst3", "title", "title",
    1.73 +                              new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst3")));
    1.74 +
    1.75 +      gQueue.push(new setAttr("tst4", "title", "title",
    1.76 +                              new invokerChecker(EVENT_NAME_CHANGE, "tst4")));
    1.77 +
    1.78 +      gQueue.invoke(); // Will call SimpleTest.finish();
    1.79 +    }
    1.80 +
    1.81 +    SimpleTest.waitForExplicitFinish();
    1.82 +    addA11yLoadEvent(doTests);
    1.83 +  </script>
    1.84 +</head>
    1.85 +
    1.86 +<body>
    1.87 +
    1.88 +  <a target="_blank"
    1.89 +     href="https://bugzilla.mozilla.org/show_bug.cgi?id=991969"
    1.90 +     title="Event not fired when description changes">
    1.91 +    Bug 991969
    1.92 +  </a>
    1.93 +
    1.94 +  <p id="display"></p>
    1.95 +  <div id="content" style="display: none"></div>
    1.96 +  <pre id="test">
    1.97 +  </pre>
    1.98 +
    1.99 +  <img id="tst1">
   1.100 +  <img id="tst2">
   1.101 +  <img id="tst3">
   1.102 +  <img id="tst4">
   1.103 +
   1.104 +  <div id="eventdump"></div>
   1.105 +</body>
   1.106 +</html>

mercurial