accessible/tests/mochitest/actions/test_keys.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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