tor-browser

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

test_bug613979.html (1212B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=613979
      5 -->
      6 <head>
      7  <title>Test for Bug 613979</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script src="/tests/SimpleTest/EventUtils.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     11 </head>
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=613979">Mozilla Bug 613979</a>
     14 <p id="display"></p>
     15 <div id="content">
     16  <input required>
     17 </div>
     18 <pre id="test">
     19 <script type="application/javascript">
     20 
     21 /** Test for Bug 613979 */
     22 
     23 var testNum = 0;
     24 var input = document.getElementsByTagName('input')[0];
     25 
     26 input.addEventListener("input", function() {
     27  if (testNum == 0) {
     28    ok(input.validity.valid, "input should be valid");
     29    testNum++;
     30    SimpleTest.executeSoon(function() {
     31      synthesizeKey("KEY_Backspace");
     32    });
     33  } else if (testNum == 1) {
     34    ok(!input.validity.valid, "input should not be valid");
     35    input.removeEventListener("input", arguments.callee);
     36    SimpleTest.finish();
     37  }
     38 });
     39 
     40 SimpleTest.waitForExplicitFinish();
     41 
     42 SimpleTest.waitForFocus(function() {
     43  input.focus();
     44  sendString("a");
     45 });
     46 
     47 </script>
     48 </pre>
     49 </body>
     50 </html>