tor-browser

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

browser_background_link_zoom_reset.js (1520B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 const TEST_PAGE = "/browser/browser/base/content/test/zoom/zoom_test.html";
      5 var gTestTab, gBgTab, gTestZoom;
      6 
      7 function testBackgroundLoad() {
      8  (async function () {
      9    is(
     10      ZoomManager.zoom,
     11      gTestZoom,
     12      "opening a background tab should not change foreground zoom"
     13    );
     14 
     15    await FullZoomHelper.removeTabAndWaitForLocationChange(gBgTab);
     16 
     17    await FullZoom.reset();
     18    await FullZoomHelper.removeTabAndWaitForLocationChange(gTestTab);
     19    finish();
     20  })();
     21 }
     22 
     23 function testInitialZoom() {
     24  (async function () {
     25    is(ZoomManager.zoom, 1, "initial zoom level should be 1");
     26    FullZoom.enlarge();
     27 
     28    gTestZoom = ZoomManager.zoom;
     29    isnot(gTestZoom, 1, "zoom level should have changed");
     30 
     31    gBgTab = BrowserTestUtils.addTab(gBrowser);
     32    await FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE);
     33  })().then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish));
     34 }
     35 
     36 function test() {
     37  waitForExplicitFinish();
     38 
     39  (async function () {
     40    gTestTab = BrowserTestUtils.addTab(gBrowser);
     41    await FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab);
     42    // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     43    await FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE);
     44  })().then(testInitialZoom, FullZoomHelper.failAndContinue(finish));
     45 }