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 file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: "use strict"; michael@0: michael@0: function test() { michael@0: let tab1, tab2; michael@0: const TEST_IMAGE = "http://example.org/browser/browser/base/content/test/general/moz.png"; michael@0: michael@0: waitForExplicitFinish(); michael@0: michael@0: Task.spawn(function () { michael@0: tab1 = gBrowser.addTab(); michael@0: tab2 = gBrowser.addTab(); michael@0: yield FullZoomHelper.selectTabAndWaitForLocationChange(tab1); michael@0: yield FullZoomHelper.load(tab1, TEST_IMAGE); michael@0: michael@0: is(ZoomManager.zoom, 1, "initial zoom level for first should be 1"); michael@0: michael@0: FullZoom.enlarge(); michael@0: let zoom = ZoomManager.zoom; michael@0: isnot(zoom, 1, "zoom level should have changed"); michael@0: michael@0: yield FullZoomHelper.selectTabAndWaitForLocationChange(tab2); michael@0: is(ZoomManager.zoom, 1, "initial zoom level for second tab should be 1"); michael@0: michael@0: yield FullZoomHelper.selectTabAndWaitForLocationChange(tab1); michael@0: is(ZoomManager.zoom, zoom, "zoom level for first tab should not have changed"); michael@0: michael@0: yield FullZoomHelper.removeTabAndWaitForLocationChange(tab1); michael@0: yield FullZoomHelper.removeTabAndWaitForLocationChange(tab2); michael@0: }).then(finish, FullZoomHelper.failAndContinue(finish)); michael@0: }