summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/tests/browser/browser_UrlbarInput_hiddenFocus.js
blob: 08e5ae97d3ab72dc6d2f9a8c718d430997d2b338 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

add_task(async function () {
  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);

  registerCleanupFunction(async function () {
    BrowserTestUtils.removeTab(tab);
    gURLBar.setURI();
  });

  gURLBar.blur();
  ok(!gURLBar.focused, "url bar is not focused");
  ok(!gURLBar.hasAttribute("focused"), "url bar is not visibly focused");
  gURLBar.setHiddenFocus();
  ok(gURLBar.focused, "url bar is focused");
  ok(!gURLBar.hasAttribute("focused"), "url bar is not visibly focused");
  gURLBar.removeHiddenFocus();
  ok(gURLBar.focused, "url bar is focused");
  ok(gURLBar.hasAttribute("focused"), "url bar is visibly focused");
});