tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_keys.html (1436B)


      1 <html>
      2 
      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" />
      8 
      9  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
     10 
     11  <script type="application/javascript"
     12          src="../common.js"></script>
     13 
     14  <script type="application/javascript">
     15    function testAcessKey(aAccOrElmOrID, aKey) {
     16      var acc = getAccessible(aAccOrElmOrID);
     17      if (!acc)
     18        return;
     19 
     20      is(acc.accessKey, aKey,
     21         "Wrong keyboard shortcut on " + prettyName(aAccOrElmOrID));
     22    }
     23 
     24    function doTest() {
     25      testAcessKey("input1", "");
     26      testAcessKey("input2", MAC ? "⌃⌥b" : "Alt+Shift+b");
     27      testAcessKey("link", MAC ? "⌃⌥l" : "Alt+Shift+l");
     28 
     29      SimpleTest.finish();
     30    }
     31 
     32    SimpleTest.waitForExplicitFinish();
     33    addA11yLoadEvent(doTest);
     34  </script>
     35 
     36 </head>
     37 
     38 <body>
     39 
     40  <a target="_blank" rel="opener"
     41     href="https://bugzilla.mozilla.org/show_bug.cgi?id=381599"
     42     title="Inverse relations cache">
     43    Mozilla Bug 381599
     44  </a>
     45  <p id="display"></p>
     46  <div id="content" style="display: none"></div>
     47  <pre id="test">
     48  </pre>
     49 
     50  <label accesskey="a">
     51    <input id="input1"/>
     52  </label>
     53  <label accesskey="b" for="input2">
     54  <input id="input2"/>
     55  <a id="link" accesskey="l">link</a>
     56 </body>
     57 </html>