michael@0: var tabElm, zoomLevel; michael@0: function start_test_prefNotSet() { 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: //capture the zoom level to test later michael@0: zoomLevel = ZoomManager.zoom; michael@0: isnot(zoomLevel, 1, "zoom level should have changed"); michael@0: michael@0: yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/moz.png"); michael@0: }).then(continue_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); michael@0: } michael@0: michael@0: function continue_test_prefNotSet () { michael@0: Task.spawn(function () { michael@0: is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image"); michael@0: FullZoom.reset(); michael@0: michael@0: yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html"); michael@0: }).then(end_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); michael@0: } michael@0: michael@0: function end_test_prefNotSet() { michael@0: Task.spawn(function () { michael@0: is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted"); michael@0: michael@0: // Reset the zoom so that other tests have a fresh zoom level michael@0: FullZoom.reset(); michael@0: yield FullZoomHelper.removeTabAndWaitForLocationChange(); michael@0: finish(); michael@0: }); michael@0: } michael@0: michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: Task.spawn(function () { michael@0: tabElm = gBrowser.addTab(); michael@0: yield FullZoomHelper.selectTabAndWaitForLocationChange(tabElm); michael@0: yield FullZoomHelper.load(tabElm, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html"); michael@0: }).then(start_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); michael@0: }