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