Test for bug 419612 - pref to not update site-specific zoom for existing background tabs. r=gavin
☠☠ backed out by 2d6fa1ee649a ☠ ☠
authorNochum Sossonko <highmind63@gmail.com>
Thu, 09 Apr 2009 08:45:07 +0200
changeset 27116 17abd3beeabfc5a00a44e5f2157017300c94920b
parent 27115 b1237eca36703defb4b7b1e3a42b843b523b4dfc
child 27117 3c687f3d4ff412bacd1e3dacedbca2903a017481
child 27128 2d6fa1ee649a41e608968c51ff46c2a002ef1d23
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersgavin
bugs419612
milestone1.9.2a1pre
Test for bug 419612 - pref to not update site-specific zoom for existing background tabs. r=gavin
browser/base/content/test/Makefile.in
browser/base/content/test/browser_bug419612.js
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -100,16 +100,17 @@ include $(topsrcdir)/config/rules.mk
                  dummy_page.html \
                  browser_bug422590.js \
                  browser_sanitize-sitepermissions.js \
                  browser_bug356571.js \
                  browser_sanitize-passwordDisabledHosts.js \
                  browser_bug479408.js \
                  browser_bug479408_sample.html \
                  browser_scope.js \
+                 browser_bug419612.js \
     $(NULL)
 
 ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 _BROWSER_FILES += browser_bug462289.js
 else
 _BROWSER_FILES += browser_customize.js
 endif
 
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_bug419612.js
@@ -0,0 +1,33 @@
+function test() {
+  waitForExplicitFinish();
+
+  let testPage = "http://example.org/browser/browser/base/content/test/dummy_page.html";
+  let prefService = Components.classes["@mozilla.org/preferences-service;1"]
+                              .getService(Components.interfaces.nsIPrefBranch);
+  let tab1 = gBrowser.selectedTab = gBrowser.addTab();
+  tab1.linkedBrowser.addEventListener("load", (function(event) {
+    event.currentTarget.removeEventListener("load", arguments.callee, true);
+    let tab2 = gBrowser.addTab();
+    tab2.linkedBrowser.addEventListener("load", (function(event) {
+      event.currentTarget.removeEventListener("load", arguments.callee, true);
+      let oldPref = prefService.getBoolPref("browser.zoom.updateBackgroundTabs");
+      FullZoom.enlarge();
+      let tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
+      gBrowser.selectedTab = tab2;
+      let tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
+      is(tab2Zoom, tab1Zoom, "Zoom should affect background tabs");
+      prefService.setBoolPref("browser.zoom.updateBackgroundTabs", false);
+      FullZoom.reset();
+      gBrowser.selectedTab = tab1;
+      tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
+      tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
+      isnot(tab1Zoom, tab2Zoom, "Zoom should not affect background tabs");
+      prefService.setBoolPref("browser.zoom.updateBackgroundTabs", oldPref);
+      gBrowser.removeTab(tab1);
+      gBrowser.removeTab(tab2);
+      finish();
+    }), true);
+    tab2.linkedBrowser.loadURI(testPage);
+  }), true);
+  content.location = testPage;
+}