browser/base/content/test/general/browser_bug559991.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.

     1 var tab;
     3 function test() {
     5   // ----------
     6   // Test setup
     8   waitForExplicitFinish();
    10   gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", true);
    11   gPrefService.setBoolPref("browser.zoom.siteSpecific", true);
    13   let uri = "http://example.org/browser/browser/base/content/test/general/dummy_page.html";
    15   Task.spawn(function () {
    16     tab = gBrowser.addTab();
    17     yield FullZoomHelper.load(tab, uri);
    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 }
    26 // -------------
    27 // Test clean-up
    28 function endTest() {
    29   Task.spawn(function () {
    30     yield FullZoomHelper.removeTabAndWaitForLocationChange(tab);
    32     tab = null;
    34     if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
    35       gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
    37     if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific"))
    38       gPrefService.clearUserPref("browser.zoom.siteSpecific");
    40     finish();
    41   });
    42 }

mercurial