tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_bug1557041.js (1290B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 add_task(async function test_identityPopupCausesFSExit() {
      7  let url = "https://example.com/";
      8 
      9  await BrowserTestUtils.withNewTab("about:blank", async browser => {
     10    let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
     11    BrowserTestUtils.startLoadingURIString(browser, url);
     12    await loaded;
     13 
     14    let identityPermissionBox = document.getElementById(
     15      "identity-permission-box"
     16    );
     17 
     18    info("Entering DOM fullscreen");
     19    await DOMFullscreenTestUtils.changeFullscreen(browser, true);
     20 
     21    let popupShown = BrowserTestUtils.waitForEvent(
     22      window,
     23      "popupshown",
     24      true,
     25      event => event.target == document.getElementById("permission-popup")
     26    );
     27    let fsExit = DOMFullscreenTestUtils.waitForFullScreenState(browser, false);
     28 
     29    identityPermissionBox.click();
     30 
     31    info("Waiting for fullscreen exit and permission popup to show");
     32    await Promise.all([fsExit, popupShown]);
     33 
     34    let identityPopup = document.getElementById("permission-popup");
     35    ok(
     36      identityPopup.hasAttribute("panelopen"),
     37      "Identity popup should be open"
     38    );
     39    ok(!window.fullScreen, "Should not be in full-screen");
     40  });
     41 });