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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/general/browser_bug419612.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,32 @@
     1.4 +function test() {
     1.5 +  waitForExplicitFinish();
     1.6 +
     1.7 +  Task.spawn(function () {
     1.8 +    let testPage = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
     1.9 +    let tab1 = gBrowser.addTab();
    1.10 +    yield FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
    1.11 +    yield FullZoomHelper.load(tab1, testPage);
    1.12 +
    1.13 +    let tab2 = gBrowser.addTab();
    1.14 +    yield FullZoomHelper.load(tab2, testPage);
    1.15 +
    1.16 +    FullZoom.enlarge();
    1.17 +    let tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
    1.18 +
    1.19 +    yield FullZoomHelper.selectTabAndWaitForLocationChange(tab2);
    1.20 +    let tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
    1.21 +    is(tab2Zoom, tab1Zoom, "Zoom should affect background tabs");
    1.22 +
    1.23 +    gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", false);
    1.24 +    FullZoom.reset();
    1.25 +    gBrowser.selectedTab = tab1;
    1.26 +    tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
    1.27 +    tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
    1.28 +    isnot(tab1Zoom, tab2Zoom, "Zoom should not affect background tabs");
    1.29 +
    1.30 +    if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
    1.31 +      gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
    1.32 +    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab1);
    1.33 +    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab2);
    1.34 +  }).then(finish, FullZoomHelper.failAndContinue(finish));
    1.35 +}

mercurial