Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | var tabElm, zoomLevel; |
michael@0 | 2 | function start_test_prefNotSet() { |
michael@0 | 3 | Task.spawn(function () { |
michael@0 | 4 | is(ZoomManager.zoom, 1, "initial zoom level should be 1"); |
michael@0 | 5 | FullZoom.enlarge(); |
michael@0 | 6 | |
michael@0 | 7 | //capture the zoom level to test later |
michael@0 | 8 | zoomLevel = ZoomManager.zoom; |
michael@0 | 9 | isnot(zoomLevel, 1, "zoom level should have changed"); |
michael@0 | 10 | |
michael@0 | 11 | yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/moz.png"); |
michael@0 | 12 | }).then(continue_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | function continue_test_prefNotSet () { |
michael@0 | 16 | Task.spawn(function () { |
michael@0 | 17 | is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image"); |
michael@0 | 18 | FullZoom.reset(); |
michael@0 | 19 | |
michael@0 | 20 | yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html"); |
michael@0 | 21 | }).then(end_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | function end_test_prefNotSet() { |
michael@0 | 25 | Task.spawn(function () { |
michael@0 | 26 | is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted"); |
michael@0 | 27 | |
michael@0 | 28 | // Reset the zoom so that other tests have a fresh zoom level |
michael@0 | 29 | FullZoom.reset(); |
michael@0 | 30 | yield FullZoomHelper.removeTabAndWaitForLocationChange(); |
michael@0 | 31 | finish(); |
michael@0 | 32 | }); |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | function test() { |
michael@0 | 36 | waitForExplicitFinish(); |
michael@0 | 37 | |
michael@0 | 38 | Task.spawn(function () { |
michael@0 | 39 | tabElm = gBrowser.addTab(); |
michael@0 | 40 | yield FullZoomHelper.selectTabAndWaitForLocationChange(tabElm); |
michael@0 | 41 | yield FullZoomHelper.load(tabElm, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html"); |
michael@0 | 42 | }).then(start_test_prefNotSet, FullZoomHelper.failAndContinue(finish)); |
michael@0 | 43 | } |