1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/general/browser_bug416661.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +var tabElm, zoomLevel; 1.5 +function start_test_prefNotSet() { 1.6 + Task.spawn(function () { 1.7 + is(ZoomManager.zoom, 1, "initial zoom level should be 1"); 1.8 + FullZoom.enlarge(); 1.9 + 1.10 + //capture the zoom level to test later 1.11 + zoomLevel = ZoomManager.zoom; 1.12 + isnot(zoomLevel, 1, "zoom level should have changed"); 1.13 + 1.14 + yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/moz.png"); 1.15 + }).then(continue_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); 1.16 +} 1.17 + 1.18 +function continue_test_prefNotSet () { 1.19 + Task.spawn(function () { 1.20 + is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image"); 1.21 + FullZoom.reset(); 1.22 + 1.23 + yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html"); 1.24 + }).then(end_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); 1.25 +} 1.26 + 1.27 +function end_test_prefNotSet() { 1.28 + Task.spawn(function () { 1.29 + is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted"); 1.30 + 1.31 + // Reset the zoom so that other tests have a fresh zoom level 1.32 + FullZoom.reset(); 1.33 + yield FullZoomHelper.removeTabAndWaitForLocationChange(); 1.34 + finish(); 1.35 + }); 1.36 +} 1.37 + 1.38 +function test() { 1.39 + waitForExplicitFinish(); 1.40 + 1.41 + Task.spawn(function () { 1.42 + tabElm = gBrowser.addTab(); 1.43 + yield FullZoomHelper.selectTabAndWaitForLocationChange(tabElm); 1.44 + yield FullZoomHelper.load(tabElm, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html"); 1.45 + }).then(start_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); 1.46 +}