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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:5ebe606d9851
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 const TEST_PAGE = "/browser/browser/base/content/test/general/dummy_page.html";
5 var gTestTab, gBgTab, gTestZoom;
6
7 function testBackgroundLoad() {
8 Task.spawn(function () {
9 is(ZoomManager.zoom, gTestZoom, "opening a background tab should not change foreground zoom");
10
11 yield FullZoomHelper.removeTabAndWaitForLocationChange(gBgTab);
12
13 FullZoom.reset();
14 yield FullZoomHelper.removeTabAndWaitForLocationChange(gTestTab);
15 finish();
16 });
17 }
18
19 function testInitialZoom() {
20 Task.spawn(function () {
21 is(ZoomManager.zoom, 1, "initial zoom level should be 1");
22 FullZoom.enlarge();
23
24 gTestZoom = ZoomManager.zoom;
25 isnot(gTestZoom, 1, "zoom level should have changed");
26
27 gBgTab = gBrowser.addTab();
28 yield FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE);
29 }).then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish));
30 }
31
32 function test() {
33 waitForExplicitFinish();
34
35 Task.spawn(function () {
36 gTestTab = gBrowser.addTab();
37 yield FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab);
38 yield FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE);
39 }).then(testInitialZoom, FullZoomHelper.failAndContinue(finish));
40 }

mercurial