tor-browser

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

test_label_contenteditable.html (616B)


      1 <!doctype html>
      2 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      3 <link rel="stylesheet" href="/tests/SimpleTest/test.css">
      4 <script src="/tests/SimpleTest/EventUtils.js"></script>
      5 <label style="display: block" contenteditable>
      6  Foo
      7 </label>
      8 <script>
      9 SimpleTest.waitForExplicitFinish();
     10 SimpleTest.waitForFocus(function() {
     11  let label = document.querySelector("label");
     12  synthesizeMouseAtCenter(label, {});
     13  is(document.activeElement, label, "Label should get focus");
     14  synthesizeKey("x", {});
     15  is(label.innerText.trim(), "Foox", "Should not select the whole label");
     16  SimpleTest.finish();
     17 });
     18 </script>