tor-browser

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

test_focusshift_button.html (1040B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test for shifting focus while mouse clicking on button</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <script src="/tests/SimpleTest/EventUtils.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      8 </head>
      9 <body>
     10 <p id="display"></p>
     11 <div id="content" style="display: none">
     12 
     13 </div>
     14 
     15 <script class="testbody" type="application/javascript">
     16 
     17 var result = "";
     18 
     19 SimpleTest.waitForExplicitFinish();
     20 SimpleTest.waitForFocus(function() {
     21  synthesizeMouseAtCenter(document.getElementById("button"), { });
     22  is(result, "(focus button)(blur button)(focus input)", "Focus button then input");
     23  SimpleTest.finish();
     24 });
     25 </script>
     26 
     27 
     28 <button id="button" onfocus="result += '(focus button)'; document.getElementById('input').focus()"
     29                    onblur="result += '(blur button)'">Focus</button>
     30 <input id="input" value="Test" onfocus="result += '(focus input)'"
     31                               onblur="result += '(blur input)'">
     32 
     33 </body>
     34 </html>