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