browser/base/content/test/general/browser_bug555224.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_bug555224.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +const TEST_PAGE = "/browser/browser/base/content/test/general/dummy_page.html";
     1.8 +var gTestTab, gBgTab, gTestZoom;
     1.9 +
    1.10 +function testBackgroundLoad() {
    1.11 +  Task.spawn(function () {
    1.12 +    is(ZoomManager.zoom, gTestZoom, "opening a background tab should not change foreground zoom");
    1.13 +
    1.14 +    yield FullZoomHelper.removeTabAndWaitForLocationChange(gBgTab);
    1.15 +
    1.16 +    FullZoom.reset();
    1.17 +    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTestTab);
    1.18 +    finish();
    1.19 +  });
    1.20 +}
    1.21 +
    1.22 +function testInitialZoom() {
    1.23 +  Task.spawn(function () {
    1.24 +    is(ZoomManager.zoom, 1, "initial zoom level should be 1");
    1.25 +    FullZoom.enlarge();
    1.26 +
    1.27 +    gTestZoom = ZoomManager.zoom;
    1.28 +    isnot(gTestZoom, 1, "zoom level should have changed");
    1.29 +
    1.30 +    gBgTab = gBrowser.addTab();
    1.31 +    yield FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE);
    1.32 +  }).then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish));
    1.33 +}
    1.34 +
    1.35 +function test() {
    1.36 +  waitForExplicitFinish();
    1.37 +
    1.38 +  Task.spawn(function () {
    1.39 +    gTestTab = gBrowser.addTab();
    1.40 +    yield FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab);
    1.41 +    yield FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE);
    1.42 +  }).then(testInitialZoom, FullZoomHelper.failAndContinue(finish));
    1.43 +}

mercurial