summaryrefslogtreecommitdiffstats
path: root/browser/components/enterprisepolicies/tests/browser/browser_policy_searchbar.js
blob: af892f2813b1312f0c7372d0c933a05fe6c47dbd (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
35
36
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

add_setup(async function () {
  await setupPolicyEngineWithJson({
    policies: {
      SearchBar: "separate",
    },
  });
});

add_task(async function test_menu_shown() {
  let newWin = await BrowserTestUtils.openNewBrowserWindow();
  let placement = CustomizableUI.getPlacementOfWidget("search-container");
  isnot(placement, null, "Search bar has a placement");
  is(
    placement.area,
    CustomizableUI.AREA_NAVBAR,
    "Search bar is in the nav bar"
  );
  await BrowserTestUtils.closeWindow(newWin);
});

add_task(async function test_menu_shown() {
  await setupPolicyEngineWithJson({
    policies: {
      SearchBar: "unified",
    },
  });
  let newWin = await BrowserTestUtils.openNewBrowserWindow();
  let placement = CustomizableUI.getPlacementOfWidget("search-container");
  is(placement, null, "Search bar has no placement");
  await BrowserTestUtils.closeWindow(newWin);
});