accessible/tests/mochitest/treeupdate/test_ariadialog.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE html>
     2 <html>
     4 <head>
     5   <title>Table creation in ARIA dialog test</title>
     7   <link rel="stylesheet" type="text/css"
     8         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
    10   <script type="application/javascript"
    11           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
    13   <script type="application/javascript"
    14           src="../common.js"></script>
    15   <script type="application/javascript"
    16           src="../role.js"></script>
    17   <script type="application/javascript"
    18           src="../events.js"></script>
    20   <script type="application/javascript">
    22     ////////////////////////////////////////////////////////////////////////////
    23     // Invokers
    25     function showARIADialog(aID)
    26     {
    27       this.node = getNode(aID);
    29       this.eventSeq = [
    30         new invokerChecker(EVENT_SHOW, this.node)
    31       ];
    33       this.invoke = function showARIADialog_invoke()
    34       {
    35         getNode("dialog").style.display = "block";
    36         getNode("table").style.visibility = "visible";
    37         getNode("a").textContent = "link";
    38         getNode("input").value = "hello";
    39         getNode("input").focus();
    40       }
    42       this.finalCheck = function showARIADialog_finalCheck()
    43       {
    44         var tree = {
    45           role: ROLE_DIALOG,
    46           children: [
    47             {
    48               role: ROLE_PUSHBUTTON,
    49               children: [ { role: ROLE_TEXT_LEAF } ]
    50             },
    51             {
    52               role: ROLE_ENTRY
    53             }
    54           ]
    55         };
    56         testAccessibleTree(aID, tree);
    57       }
    59       this.getID = function showARIADialog_getID()
    60       {
    61         return "show ARIA dialog";
    62       }
    63     }
    65     ////////////////////////////////////////////////////////////////////////////
    66     // Test
    68     //gA11yEventDumpID = "eventdump"; // debug stuff
    69     //gA11yEventDumpToConsole = true;
    71     var gQueue = null;
    73     function doTest()
    74     {
    75       gQueue = new eventQueue();
    77       // make the accessible an inaccessible
    78       gQueue.push(new showARIADialog("dialog"));
    80       gQueue.invoke(); // SimpleTest.finish() will be called in the end
    81     }
    83     SimpleTest.waitForExplicitFinish();
    84     addA11yLoadEvent(doTest);
    85   </script>
    86 </head>
    87 <body>
    89   <a target="_blank"
    90      title="Rework accessible tree update code"
    91      href="https://bugzilla.mozilla.org/show_bug.cgi?id=570275">
    92     Mozilla Bug 570275
    93   </a>
    95   <p id="display"></p>
    96   <div id="content" style="display: none"></div>
    97   <pre id="test">
    98   </pre>
   100   <div id="dialog" role="dialog" style="display: none;">
   101     <table id="table" role="presentation"
   102            style="display: block; position: fixed; top: 88px; left: 312.5px; z-index: 10010; visibility: hidden;">
   103       <tbody>
   104         <tr>
   105           <td role="presentation">
   106             <div role="presentation">
   107               <a id="a" role="button">text</a>
   108             </div>
   109             <input id="input">
   110           </td>
   111         </tr>
   112       </tbody>
   113     </table>
   114   </div>
   116   <div id="eventdump"></div>
   117 </body>
   118 </html>

mercurial