michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: const TEST_PAGE = "/browser/browser/base/content/test/general/dummy_page.html"; michael@0: var gTestTab, gBgTab, gTestZoom; michael@0: michael@0: function testBackgroundLoad() { michael@0: Task.spawn(function () { michael@0: is(ZoomManager.zoom, gTestZoom, "opening a background tab should not change foreground zoom"); michael@0: michael@0: yield FullZoomHelper.removeTabAndWaitForLocationChange(gBgTab); michael@0: michael@0: FullZoom.reset(); michael@0: yield FullZoomHelper.removeTabAndWaitForLocationChange(gTestTab); michael@0: finish(); michael@0: }); michael@0: } michael@0: michael@0: function testInitialZoom() { michael@0: Task.spawn(function () { michael@0: is(ZoomManager.zoom, 1, "initial zoom level should be 1"); michael@0: FullZoom.enlarge(); michael@0: michael@0: gTestZoom = ZoomManager.zoom; michael@0: isnot(gTestZoom, 1, "zoom level should have changed"); michael@0: michael@0: gBgTab = gBrowser.addTab(); michael@0: yield FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE); michael@0: }).then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish)); michael@0: } michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: Task.spawn(function () { michael@0: gTestTab = gBrowser.addTab(); michael@0: yield FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab); michael@0: yield FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE); michael@0: }).then(testInitialZoom, FullZoomHelper.failAndContinue(finish)); michael@0: }