From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../test/browser/browser_privatebrowsing_zoom.js | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js (limited to 'browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js') diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js new file mode 100644 index 0000000000..048796e7d2 --- /dev/null +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js @@ -0,0 +1,46 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// This test makes sure that private browsing turns off doesn't cause zoom +// settings to be reset on tab switch (bug 464962) + +add_task(async function test() { + let win = await BrowserTestUtils.openNewBrowserWindow({ private: true }); + let tabAbout = await BrowserTestUtils.openNewForegroundTab( + win.gBrowser, + "about:mozilla" + ); + let tabMozilla = await BrowserTestUtils.openNewForegroundTab( + win.gBrowser, + "about:mozilla" + ); + + let mozillaZoom = win.ZoomManager.zoom; + + // change the zoom on the mozilla page + win.FullZoom.enlarge(); + // make sure the zoom level has been changed + isnot(win.ZoomManager.zoom, mozillaZoom, "Zoom level can be changed"); + mozillaZoom = win.ZoomManager.zoom; + + // switch to about: tab + await BrowserTestUtils.switchTab(win.gBrowser, tabAbout); + + // switch back to mozilla tab + await BrowserTestUtils.switchTab(win.gBrowser, tabMozilla); + + // make sure the zoom level has not changed + is( + win.ZoomManager.zoom, + mozillaZoom, + "Entering private browsing should not reset the zoom on a tab" + ); + + // cleanup + win.FullZoom.reset(); + BrowserTestUtils.removeTab(tabMozilla); + BrowserTestUtils.removeTab(tabAbout); + + await BrowserTestUtils.closeWindow(win); +}); -- cgit v1.2.3