Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | var tab; |
michael@0 | 2 | |
michael@0 | 3 | function test() { |
michael@0 | 4 | |
michael@0 | 5 | // ---------- |
michael@0 | 6 | // Test setup |
michael@0 | 7 | |
michael@0 | 8 | waitForExplicitFinish(); |
michael@0 | 9 | |
michael@0 | 10 | gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", true); |
michael@0 | 11 | gPrefService.setBoolPref("browser.zoom.siteSpecific", true); |
michael@0 | 12 | |
michael@0 | 13 | let uri = "http://example.org/browser/browser/base/content/test/general/dummy_page.html"; |
michael@0 | 14 | |
michael@0 | 15 | Task.spawn(function () { |
michael@0 | 16 | tab = gBrowser.addTab(); |
michael@0 | 17 | yield FullZoomHelper.load(tab, uri); |
michael@0 | 18 | |
michael@0 | 19 | // ------------------------------------------------------------------- |
michael@0 | 20 | // Test - Trigger a tab switch that should update the zoom level |
michael@0 | 21 | yield FullZoomHelper.selectTabAndWaitForLocationChange(tab); |
michael@0 | 22 | ok(true, "applyPrefToSetting was called"); |
michael@0 | 23 | }).then(endTest, FullZoomHelper.failAndContinue(endTest)); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | // ------------- |
michael@0 | 27 | // Test clean-up |
michael@0 | 28 | function endTest() { |
michael@0 | 29 | Task.spawn(function () { |
michael@0 | 30 | yield FullZoomHelper.removeTabAndWaitForLocationChange(tab); |
michael@0 | 31 | |
michael@0 | 32 | tab = null; |
michael@0 | 33 | |
michael@0 | 34 | if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs")) |
michael@0 | 35 | gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs"); |
michael@0 | 36 | |
michael@0 | 37 | if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific")) |
michael@0 | 38 | gPrefService.clearUserPref("browser.zoom.siteSpecific"); |
michael@0 | 39 | |
michael@0 | 40 | finish(); |
michael@0 | 41 | }); |
michael@0 | 42 | } |