dom/events/test/test_bug586961.xul

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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">
    10   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
    11   <script type="application/javascript" 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>
    15   <p id="display"></p>
    16 <div id="content" style="display: none">
    17 </div>
    18 </body>
    20 <box onclick="clicked(event)">
    21   <label id="controllabel" control="controlbutton" accesskey="k" value="Click here" />
    22   <button id="controlbutton" label="Button" />
    23 </box>
    25 <script class="testbody" type="application/javascript;version=1.7"><![CDATA[
    27 /** Test for Bug 586961 **/
    29 function clicked(event) {
    30   is(event.target.id, "controlbutton", "Accesskey was directed to controlled element.");
    31   SimpleTest.finish();
    32 }
    34 function test() {
    35   var accessKeyDetails = (navigator.platform.indexOf("Mac") >= 0) ?
    36                          { altKey : true, ctrlKey : true } : 
    37                          { altKey : true, shiftKey: true };
    38   synthesizeKey("k", accessKeyDetails);
    39 }
    41 SimpleTest.waitForExplicitFinish();
    42 SimpleTest.waitForFocus(test, window);
    44 ]]></script>
    46 </window>

mercurial