tor-browser

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

browser_fullscreen_notification.js (1237B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   https://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 add_task(async function test_check_fullscreen_notification_visibility() {
      7  info("Showing notification\n");
      8  let notification = await gNotificationBox.appendNotification(
      9    "test-fullscreen-notification",
     10    {
     11      label: "Test Fullscreen Notification",
     12      priority: gNotificationBox.PRIORITY_INFO_HIGH,
     13    }
     14  );
     15 
     16  Assert.ok(
     17    BrowserTestUtils.isVisible(notification),
     18    "Notification should be visible before fullscreen."
     19  );
     20 
     21  const fullScreenEntered = BrowserTestUtils.waitForEvent(window, "fullscreen");
     22 
     23  EventUtils.synthesizeKey("KEY_F11", {});
     24 
     25  info(`Waiting for entering fullscreen mode...`);
     26  await fullScreenEntered;
     27 
     28  Assert.ok(
     29    BrowserTestUtils.isVisible(notification),
     30    "Notification should be visible after entering fullscreen."
     31  );
     32 
     33  const fullScreenExited = BrowserTestUtils.waitForEvent(window, "fullscreen");
     34 
     35  EventUtils.synthesizeKey("KEY_F11", {});
     36 
     37  info(`Waiting for exiting fullscreen mode...`);
     38  await fullScreenExited;
     39 
     40  Assert.ok(
     41    BrowserTestUtils.isVisible(notification),
     42    "Notification should be visible after exiting fullscreen."
     43  );
     44 });