browser/base/content/test/general/browser_bug419612.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 function test() {
michael@0 2 waitForExplicitFinish();
michael@0 3
michael@0 4 Task.spawn(function () {
michael@0 5 let testPage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
michael@0 6 let tab1 = gBrowser.addTab();
michael@0 7 yield FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
michael@0 8 yield FullZoomHelper.load(tab1, testPage);
michael@0 9
michael@0 10 let tab2 = gBrowser.addTab();
michael@0 11 yield FullZoomHelper.load(tab2, testPage);
michael@0 12
michael@0 13 FullZoom.enlarge();
michael@0 14 let tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
michael@0 15
michael@0 16 yield FullZoomHelper.selectTabAndWaitForLocationChange(tab2);
michael@0 17 let tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
michael@0 18 is(tab2Zoom, tab1Zoom, "Zoom should affect background tabs");
michael@0 19
michael@0 20 gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", false);
michael@0 21 FullZoom.reset();
michael@0 22 gBrowser.selectedTab = tab1;
michael@0 23 tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
michael@0 24 tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
michael@0 25 isnot(tab1Zoom, tab2Zoom, "Zoom should not affect background tabs");
michael@0 26
michael@0 27 if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
michael@0 28 gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
michael@0 29 yield FullZoomHelper.removeTabAndWaitForLocationChange(tab1);
michael@0 30 yield FullZoomHelper.removeTabAndWaitForLocationChange(tab2);
michael@0 31 }).then(finish, FullZoomHelper.failAndContinue(finish));
michael@0 32 }

mercurial