accessible/tests/mochitest/actions/test_link.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 <html>
     3 <head>
     4   <title>nsIAccessible actions testing on HTML links (HTML:a)</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>
    12   <script type="application/javascript"
    13           src="../common.js"></script>
    14   <script type="application/javascript"
    15           src="../events.js"></script>
    16   <script type="application/javascript"
    17           src="../actions.js"></script>
    19   <script type="application/javascript">
    20     function getAnchorTargetDocumentAcc()
    21     {
    22       var thisTabDocAcc = getTabDocAccessible();
    23       var thisDocTabPanelAcc = thisTabDocAcc.parent.parent;
    24       var tabPanelsAcc = thisDocTabPanelAcc.parent;
    25       var newDocTabPanelAcc = tabPanelsAcc.lastChild.firstChild;
    26       return newDocTabPanelAcc.firstChild;
    27     }
    29     function linkChecker(aID)
    30     {
    31       this.type = EVENT_DOCUMENT_LOAD_COMPLETE;
    32       this.__defineGetter__("target", getAnchorTargetDocumentAcc);
    34       this.check = function linkChecker_check()
    35       {
    36         var anchorTargetWindow =
    37           getAccessible(getAnchorTargetDocumentAcc(), [nsIAccessibleDocument]).
    38           window;
    39         anchorTargetWindow.close();
    40       }
    42       this.getID = function linkChecker_getID()
    43       {
    44         return "link '" + aID + "' states check ";
    45       }
    46     }
    48     //gA11yEventDumpID = "eventdump"; // debug stuff
    49     gA11yEventDumpToConsole = true;
    51     function doTest()
    52     {
    53       var actionsArray = [
    54         {
    55           ID: "link1",
    56           actionName: "jump",
    57           events: CLICK_EVENTS,
    58           eventSeq: [
    59             new linkChecker("link1")
    60           ]
    61         },
    62         {
    63           ID: "img1",
    64           targetID: "link1",
    65           actionName: "jump",
    66           events: CLICK_EVENTS,
    67           eventSeq: [
    68             new linkChecker("link1")
    69           ]
    70         },
    71         {
    72           ID: "link2",
    73           actionName: "click",
    74           events: CLICK_EVENTS
    75         },
    76         {
    77           ID: "img2",
    78           targetID: "link2",
    79           actionName: "jump",
    80           events: CLICK_EVENTS
    81         },
    82         {
    83           ID: "link3",
    84           actionName: "click",
    85           events: CLICK_EVENTS
    86         },
    87         {
    88           ID: "img3",
    89           targetID: "link3",
    90           actionName: "jump",
    91           events: CLICK_EVENTS
    92         },
    93         {
    94           ID: "link4",
    95           actionName: "click",
    96           events: CLICK_EVENTS
    97         },
    98         {
    99           ID: "img4",
   100           targetID: "link4",
   101           actionName: "jump",
   102           events: CLICK_EVENTS
   103         }
   104       ];
   105       testActions(actionsArray);
   106     }
   108     SimpleTest.waitForExplicitFinish();
   109     addA11yLoadEvent(doTest);
   110   </script>
   111 </head>
   113 <body>
   115   <a target="_blank"
   116      href="https://bugzilla.mozilla.org/show_bug.cgi?id=423409"
   117      title="Expose click action if mouseup and mousedown are registered">
   118     Mozilla Bug 423409
   119   </a>
   120   <p id="display"></p>
   121   <div id="content" style="display: none"></div>
   122   <pre id="test">
   123   </pre>
   125   <a href="about:mozilla" id="link1" target="_blank">
   126     <img src="../moz.png" id="img1">
   127   </a>
   128   <a id="link2" onmousedown="">
   129     <img src="../moz.png" id="img2">
   130   </a>
   131   <a id="link3" onclick="">
   132     <img src="../moz.png" id="img3">
   133   </a>
   134   <a id="link4" onmouseup="">
   135     <img src="../moz.png" id="img4">
   136   </a>
   138   <div id="eventdump"></div>
   139 </body>
   140 </html>

mercurial