tor-browser

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

show-picker-does-not-focus.html (946B)


      1 <!DOCTYPE html>
      2 <title>Test showPicker() does not focus the element</title>
      3 <meta name="timeout" content="long">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-vendor.js"></script>
      8 
      9 <body>
     10 <script type=module>
     11 import inputTypes from "./input-types.js";
     12 
     13 function createElement(t, type) {
     14  const input = document.createElement("input");
     15  input.type = type;
     16  document.body.append(input);
     17  t.add_cleanup(() => input.remove());
     18  return input;
     19 }
     20 
     21 for (const inputType of inputTypes) {
     22  promise_test(async (t) => {
     23    const input = createElement(t, inputType);
     24    await test_driver.bless('show picker');
     25    input.showPicker();
     26    assert_not_equals(input, document.activeElement, "Input element was not focused");
     27  }, `input[type=${inputType}].showPicker() does not focus the element`);
     28 }
     29 </script>