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