browser_tabswitch_zoom_flicker.js (1305B)
1 var tab; 2 3 function test() { 4 // ---------- 5 // Test setup 6 7 waitForExplicitFinish(); 8 9 Services.prefs.setBoolPref("browser.zoom.updateBackgroundTabs", true); 10 Services.prefs.setBoolPref("browser.zoom.siteSpecific", true); 11 12 let uri = 13 // eslint-disable-next-line @microsoft/sdl/no-insecure-url 14 "http://example.org/browser/browser/base/content/test/zoom/zoom_test.html"; 15 16 (async function () { 17 tab = BrowserTestUtils.addTab(gBrowser); 18 await FullZoomHelper.load(tab, uri); 19 20 // ------------------------------------------------------------------- 21 // Test - Trigger a tab switch that should update the zoom level 22 await FullZoomHelper.selectTabAndWaitForLocationChange(tab); 23 ok(true, "applyPrefToSetting was called"); 24 })().then(endTest, FullZoomHelper.failAndContinue(endTest)); 25 } 26 27 // ------------- 28 // Test clean-up 29 function endTest() { 30 (async function () { 31 await FullZoomHelper.removeTabAndWaitForLocationChange(tab); 32 33 tab = null; 34 35 if (Services.prefs.prefHasUserValue("browser.zoom.updateBackgroundTabs")) { 36 Services.prefs.clearUserPref("browser.zoom.updateBackgroundTabs"); 37 } 38 39 if (Services.prefs.prefHasUserValue("browser.zoom.siteSpecific")) { 40 Services.prefs.clearUserPref("browser.zoom.siteSpecific"); 41 } 42 43 finish(); 44 })(); 45 }