accessible/tests/mochitest/events/test_namechange.html

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 <html>
     3 <head>
     4   <title>Accessible name change event testing</title>
     6   <link rel="stylesheet" type="text/css"
     7         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
     9   <script type="application/javascript"
    10           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    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="../events.js"></script>
    18   <script type="application/javascript"
    19           src="../role.js"></script>
    20   <script type="application/javascript"
    21           src="../states.js"></script>
    23   <script type="application/javascript">
    24     ////////////////////////////////////////////////////////////////////////////
    25     // Invokers
    27     function setAttr(aID, aAttr, aValue, aChecker)
    28     {
    29       this.eventSeq = [ aChecker ];
    30       this.invoke = function setAttr_invoke()
    31       {
    32         getNode(aID).setAttribute(aAttr, aValue);
    33       }
    35       this.getID = function setAttr_getID()
    36       {
    37         return "set attr '" + aAttr + "', value '" + aValue + "'";
    38       }
    39     }
    41     ////////////////////////////////////////////////////////////////////////////
    42     // Do tests
    44     //gA11yEventDumpToConsole = true; // debuggin
    46     var gQueue = null;
    47     function doTests()
    48     {
    49       gQueue = new eventQueue();
    51       gQueue.push(new setAttr("tst1", "aria-label", "hi",
    52                               new invokerChecker(EVENT_NAME_CHANGE, "tst1")));
    53       gQueue.push(new setAttr("tst1", "aria-labelledby", "display",
    54                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
    55       gQueue.push(new setAttr("tst1", "alt", "alt",
    56                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
    57       gQueue.push(new setAttr("tst1", "title", "title",
    58                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst1")));
    60       gQueue.push(new setAttr("tst2", "aria-labelledby", "display",
    61                               new invokerChecker(EVENT_NAME_CHANGE, "tst2")));
    62       gQueue.push(new setAttr("tst2", "alt", "alt",
    63                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst2")));
    64       gQueue.push(new setAttr("tst2", "title", "title",
    65                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst2")));
    67       gQueue.push(new setAttr("tst3", "alt", "alt",
    68                               new invokerChecker(EVENT_NAME_CHANGE, "tst3")));
    69       gQueue.push(new setAttr("tst3", "title", "title",
    70                               new unexpectedInvokerChecker(EVENT_NAME_CHANGE, "tst3")));
    72       gQueue.push(new setAttr("tst4", "title", "title",
    73                               new invokerChecker(EVENT_NAME_CHANGE, "tst4")));
    75       gQueue.invoke(); // Will call SimpleTest.finish();
    76     }
    78     SimpleTest.waitForExplicitFinish();
    79     addA11yLoadEvent(doTests);
    80   </script>
    81 </head>
    83 <body>
    85   <a target="_blank"
    86      href="https://bugzilla.mozilla.org/show_bug.cgi?id=991969"
    87      title="Event not fired when description changes">
    88     Bug 991969
    89   </a>
    91   <p id="display"></p>
    92   <div id="content" style="display: none"></div>
    93   <pre id="test">
    94   </pre>
    96   <img id="tst1">
    97   <img id="tst2">
    98   <img id="tst3">
    99   <img id="tst4">
   101   <div id="eventdump"></div>
   102 </body>
   103 </html>

mercurial