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

add_task(async function () {
  // Test that Ctrl/Cmd + K will focus the url bar
  let focusPromise = BrowserTestUtils.waitForEvent(gURLBar, "focus");
  document.documentElement.focus();
  EventUtils.synthesizeKey("k", { accelKey: true });
  await focusPromise;
  Assert.equal(
    document.activeElement,
    gURLBar.inputField,
    "URL Bar should be focused"
  );
});