tor-browser

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

browser_pip_fullscreen_disallowed.js (1163B)


      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 check_chrome_window_of_pip_cannot_fullscreen() {
      7  const [tab, chromePiP] = await newTabWithPiP();
      8 
      9  // Sanity check: VK_F11 will set window.fullScreen via View:Fullscreen command
     10  const fullScreenEntered = BrowserTestUtils.waitForEvent(window, "fullscreen");
     11  window.fullScreen = true;
     12  ok(window.fullScreen, "FS works as expected on window");
     13  await fullScreenEntered;
     14  ok(true, "Got fullscreen event");
     15 
     16  const fullScreenExited = BrowserTestUtils.waitForEvent(window, "fullscreen");
     17  window.fullScreen = false;
     18  ok(!window.fullScreen, "FS works as expected on window");
     19  await fullScreenExited;
     20  ok(true, "Got fullscreen event");
     21 
     22  // Check PiP cannot be fullscreened by chrome
     23  is(
     24    chromePiP.location.href,
     25    "chrome://browser/content/browser.xhtml",
     26    "Got the chrome window of the PiP"
     27  );
     28  chromePiP.fullScreen = true;
     29  ok(!chromePiP.fullScreen, "Didn't enter fullscreen on PiP");
     30 
     31  // Cleanup.
     32  await BrowserTestUtils.closeWindow(chromePiP);
     33  BrowserTestUtils.removeTab(tab);
     34 });