browser/base/content/test/general/browser_bug559991.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_bug559991.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +var tab;
     1.5 +
     1.6 +function test() {
     1.7 +
     1.8 +  // ----------
     1.9 +  // Test setup
    1.10 +
    1.11 +  waitForExplicitFinish();
    1.12 +
    1.13 +  gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", true);
    1.14 +  gPrefService.setBoolPref("browser.zoom.siteSpecific", true);
    1.15 +
    1.16 +  let uri = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
    1.17 +
    1.18 +  Task.spawn(function () {
    1.19 +    tab = gBrowser.addTab();
    1.20 +    yield FullZoomHelper.load(tab, uri);
    1.21 +
    1.22 +    // -------------------------------------------------------------------
    1.23 +    // Test - Trigger a tab switch that should update the zoom level
    1.24 +    yield FullZoomHelper.selectTabAndWaitForLocationChange(tab);
    1.25 +    ok(true, "applyPrefToSetting was called");
    1.26 +  }).then(endTest, FullZoomHelper.failAndContinue(endTest));
    1.27 +}
    1.28 +
    1.29 +// -------------
    1.30 +// Test clean-up
    1.31 +function endTest() {
    1.32 +  Task.spawn(function () {
    1.33 +    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab);
    1.34 +
    1.35 +    tab = null;
    1.36 +
    1.37 +    if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
    1.38 +      gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
    1.39 +
    1.40 +    if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific"))
    1.41 +      gPrefService.clearUserPref("browser.zoom.siteSpecific");
    1.42 +
    1.43 +    finish();
    1.44 +  });
    1.45 +}

mercurial