accessible/tests/mochitest/actions/test_keys.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   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
     5   <title>Keyboard shortcuts tests</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>
    15   <script type="application/javascript">
    16     function testAcessKey(aAccOrElmOrID, aKey)
    17     {
    18       var acc = getAccessible(aAccOrElmOrID);
    19       if (!acc)
    20         return;
    22       is(acc.accessKey, aKey,
    23          "Wrong keyboard shortcut on " + prettyName(aAccOrElmOrID));
    24     }
    26     function doTest()
    27     {
    28       testAcessKey("input1", "");
    29       testAcessKey("input2", MAC ? "⌃⌥b" : "Alt+Shift+b");
    30       testAcessKey("link", MAC ? "⌃⌥l" : "Alt+Shift+l");
    32       SimpleTest.finish();
    33     }
    35     SimpleTest.waitForExplicitFinish();
    36     addA11yLoadEvent(doTest);
    37   </script>
    39 </head>
    41 <body>
    43   <a target="_blank"
    44      href="https://bugzilla.mozilla.org/show_bug.cgi?id=381599"
    45      title="Inverse relations cache">
    46     Mozilla Bug 381599
    47   </a>
    48   <p id="display"></p>
    49   <div id="content" style="display: none"></div>
    50   <pre id="test">
    51   </pre>
    53   <label accesskey="a">
    54     <input id="input1"/>
    55   </label>
    56   <label accesskey="b" for="input2">
    57   <input id="input2"/>
    58   <a id="link" accesskey="l">link</a>
    59 </body>
    60 </html>

mercurial