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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | const TEST_PAGE = "/browser/browser/base/content/test/general/dummy_page.html"; |
michael@0 | 5 | var gTestTab, gBgTab, gTestZoom; |
michael@0 | 6 | |
michael@0 | 7 | function testBackgroundLoad() { |
michael@0 | 8 | Task.spawn(function () { |
michael@0 | 9 | is(ZoomManager.zoom, gTestZoom, "opening a background tab should not change foreground zoom"); |
michael@0 | 10 | |
michael@0 | 11 | yield FullZoomHelper.removeTabAndWaitForLocationChange(gBgTab); |
michael@0 | 12 | |
michael@0 | 13 | FullZoom.reset(); |
michael@0 | 14 | yield FullZoomHelper.removeTabAndWaitForLocationChange(gTestTab); |
michael@0 | 15 | finish(); |
michael@0 | 16 | }); |
michael@0 | 17 | } |
michael@0 | 18 | |
michael@0 | 19 | function testInitialZoom() { |
michael@0 | 20 | Task.spawn(function () { |
michael@0 | 21 | is(ZoomManager.zoom, 1, "initial zoom level should be 1"); |
michael@0 | 22 | FullZoom.enlarge(); |
michael@0 | 23 | |
michael@0 | 24 | gTestZoom = ZoomManager.zoom; |
michael@0 | 25 | isnot(gTestZoom, 1, "zoom level should have changed"); |
michael@0 | 26 | |
michael@0 | 27 | gBgTab = gBrowser.addTab(); |
michael@0 | 28 | yield FullZoomHelper.load(gBgTab, "http://mochi.test:8888" + TEST_PAGE); |
michael@0 | 29 | }).then(testBackgroundLoad, FullZoomHelper.failAndContinue(finish)); |
michael@0 | 30 | } |
michael@0 | 31 | |
michael@0 | 32 | function test() { |
michael@0 | 33 | waitForExplicitFinish(); |
michael@0 | 34 | |
michael@0 | 35 | Task.spawn(function () { |
michael@0 | 36 | gTestTab = gBrowser.addTab(); |
michael@0 | 37 | yield FullZoomHelper.selectTabAndWaitForLocationChange(gTestTab); |
michael@0 | 38 | yield FullZoomHelper.load(gTestTab, "http://example.org" + TEST_PAGE); |
michael@0 | 39 | }).then(testInitialZoom, FullZoomHelper.failAndContinue(finish)); |
michael@0 | 40 | } |