michael@0: var tab; michael@0: michael@0: function test() { michael@0: michael@0: // ---------- michael@0: // Test setup michael@0: michael@0: waitForExplicitFinish(); michael@0: michael@0: gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", true); michael@0: gPrefService.setBoolPref("browser.zoom.siteSpecific", true); michael@0: michael@0: let uri = "http://example.org/browser/browser/base/content/test/general/dummy_page.html"; michael@0: michael@0: Task.spawn(function () { michael@0: tab = gBrowser.addTab(); michael@0: yield FullZoomHelper.load(tab, uri); michael@0: michael@0: // ------------------------------------------------------------------- michael@0: // Test - Trigger a tab switch that should update the zoom level michael@0: yield FullZoomHelper.selectTabAndWaitForLocationChange(tab); michael@0: ok(true, "applyPrefToSetting was called"); michael@0: }).then(endTest, FullZoomHelper.failAndContinue(endTest)); michael@0: } michael@0: michael@0: // ------------- michael@0: // Test clean-up michael@0: function endTest() { michael@0: Task.spawn(function () { michael@0: yield FullZoomHelper.removeTabAndWaitForLocationChange(tab); michael@0: michael@0: tab = null; michael@0: michael@0: if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs")) michael@0: gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs"); michael@0: michael@0: if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific")) michael@0: gPrefService.clearUserPref("browser.zoom.siteSpecific"); michael@0: michael@0: finish(); michael@0: }); michael@0: }