browser_sitespecific_background_pref.js (1498B)
1 function test() { 2 waitForExplicitFinish(); 3 4 (async function () { 5 let testPage = 6 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 7 "http://example.org/browser/browser/base/content/test/zoom/zoom_test.html"; 8 let tab1 = BrowserTestUtils.addTab(gBrowser); 9 await FullZoomHelper.selectTabAndWaitForLocationChange(tab1); 10 await FullZoomHelper.load(tab1, testPage); 11 12 let tab2 = BrowserTestUtils.addTab(gBrowser); 13 await FullZoomHelper.load(tab2, testPage); 14 15 await FullZoom.enlarge(); 16 let tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser); 17 18 await FullZoomHelper.selectTabAndWaitForLocationChange(tab2); 19 let tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser); 20 is(tab2Zoom, tab1Zoom, "Zoom should affect background tabs"); 21 22 Services.prefs.setBoolPref("browser.zoom.updateBackgroundTabs", false); 23 await FullZoom.reset(); 24 gBrowser.selectedTab = tab1; 25 tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser); 26 tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser); 27 isnot(tab1Zoom, tab2Zoom, "Zoom should not affect background tabs"); 28 29 if (Services.prefs.prefHasUserValue("browser.zoom.updateBackgroundTabs")) { 30 Services.prefs.clearUserPref("browser.zoom.updateBackgroundTabs"); 31 } 32 await FullZoomHelper.removeTabAndWaitForLocationChange(tab1); 33 await FullZoomHelper.removeTabAndWaitForLocationChange(tab2); 34 })().then(finish, FullZoomHelper.failAndContinue(finish)); 35 }