tor-browser

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

test_bug586961.xhtml (1483B)


      1 <?xml version="1.0"?>
      2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
      3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
      4 <!--
      5 https://bugzilla.mozilla.org/show_bug.cgi?id=586961
      6 -->
      7 <window title="Mozilla Bug 586961"
      8  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      9 
     10  <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
     11  <script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
     12 <body  xmlns="http://www.w3.org/1999/xhtml">
     13  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=586961">Mozilla Bug 586961</a>
     14 
     15  <p id="display"></p>
     16 <div id="content" style="display: none">
     17 </div>
     18 </body>
     19 
     20 <box onclick="clicked(event)">
     21  <label id="controllabel" control="controlbutton" accesskey="k" value="Click here" />
     22  <button id="controlbutton" label="Button" />
     23 </box>
     24 
     25 <script class="testbody" type="application/javascript"><![CDATA[
     26 
     27 /** Test for Bug 586961 */
     28 
     29 function clicked(event) {
     30  is(event.target.id, "controlbutton", "Accesskey was directed to controlled element.");
     31  SimpleTest.finish();
     32 }
     33 
     34 function test() {
     35  var accessKeyDetails = (navigator.platform.includes("Mac")) ?
     36                         { altKey : true, ctrlKey : true } : 
     37                         { altKey : true, shiftKey: true };
     38  synthesizeKey("k", accessKeyDetails);
     39 }
     40 
     41 SimpleTest.waitForExplicitFinish();
     42 SimpleTest.waitForFocus(test, window);
     43 
     44 ]]></script>
     45 
     46 </window>