summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/referrer/browser_referrer_open_link_in_container_tab2.js
blob: 660b946e03f61483cb3379fd068a0687bc86f9b6 (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
37
38
39
40
41
42
43
// Tests referrer on context menu navigation - open link in new container tab.
// Selects "open link in new container tab" from the context menu.

// The test runs from a container ID 1.
// Output: we have the correct referrer policy applied.

function startNewTabTestCase(aTestNumber) {
  info(
    "browser_referrer_open_link_in_container_tab: " +
      getReferrerTestDescription(aTestNumber)
  );
  contextMenuOpened(gTestWindow, "testlink").then(function (aContextMenu) {
    someTabLoaded(gTestWindow).then(function (aNewTab) {
      gTestWindow.gBrowser.selectedTab = aNewTab;

      checkReferrerAndStartNextTest(
        aTestNumber,
        null,
        aNewTab,
        startNewTabTestCase,
        { userContextId: 1 }
      );
    });

    doContextMenuCommand(
      gTestWindow,
      aContextMenu,
      "context-openlinkincontainertab"
    );
  });
}

function test() {
  waitForExplicitFinish();

  SpecialPowers.pushPrefEnv(
    { set: [["privacy.userContext.enabled", true]] },
    function () {
      requestLongerTimeout(10); // slowwww shutdown on e10s
      startReferrerTest(startNewTabTestCase, { userContextId: 1 });
    }
  );
}