summaryrefslogtreecommitdiffstats
path: root/browser/components/sessionstore/test/browser_focus_after_restore.js
blob: 220827657eabff0a1d7320dd98a6ca7fde8b34df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

add_task(async function test() {
  gURLBar.focus();
  is(
    document.activeElement,
    gURLBar.inputField,
    "urlbar is focused before restoring"
  );

  await promiseBrowserState({
    windows: [
      {
        tabs: [
          {
            entries: [
              {
                url: "http://example.org/",
                triggeringPrincipal_base64,
              },
            ],
          },
        ],
        selected: 1,
      },
    ],
  });
  is(
    document.activeElement,
    gBrowser.selectedBrowser,
    "content area is focused after restoring"
  );
});