Merge mozilla-central to mozilla-inbound
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 08 Oct 2013 15:20:34 +0200
changeset 150083 d1cd57876e48971fecbcd4081934b8afc689ab7a
parent 150082 a2cbdc13f493e52bc20cb09b979a0f4285d4d07e (current diff)
parent 150076 e48cee83453d378e11a896fe1894cbf0e9a1e1f6 (diff)
child 150084 0263aa7988122b2c61eb84224c0a0f61e1a85351
push id25423
push usercbook@mozilla.com
push dateWed, 09 Oct 2013 08:10:49 +0000
treeherdermozilla-central@2a8a173a0ae1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to mozilla-inbound
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "1b6e18072e79f6c269b8954a8ff5868ee9dd0bec", 
+    "revision": "4fb5bfaab97509c259dd9e3ad865b90b527c7757", 
     "repo_path": "/integration/gaia-central"
 }
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -238,20 +238,16 @@ var FullZoom = {
       return;
 
     // Ignore all pending async zoom accesses in the browser.  Pending accesses
     // that started before the location change will be prevented from applying
     // to the new location.
     let browser = aBrowser || gBrowser.selectedBrowser;
     this._ignorePendingZoomAccesses(browser);
 
-    // Bug 691614 - zooming support for electrolysis
-    if (gMultiProcessBrowser)
-      return;
-
     if (!aURI || (aIsTabSwitch && !this.siteSpecific)) {
       this._notifyOnLocationChange();
       return;
     }
 
     // Avoid the cps roundtrip and apply the default/global pref.
     if (aURI.spec == "about:blank") {
       this._applyPrefToZoom(undefined, browser,
--- a/browser/base/content/test/general/browser_bug386835.js
+++ b/browser/base/content/test/general/browser_bug386835.js
@@ -75,15 +75,15 @@ function imageZoomSwitch() {
 
 var finishTestStarted  = false;
 function finishTest() {
   Task.spawn(function () {
     ok(!finishTestStarted, "finishTest called more than once");
     finishTestStarted = true;
     yield FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     FullZoom.reset();
-    gBrowser.removeTab(gTab1);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTab1);
     FullZoom.reset();
-    gBrowser.removeTab(gTab2);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTab2);
     FullZoom.reset();
-    gBrowser.removeTab(gTab3);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTab3);
   }).then(finish, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/browser_bug416661.js
+++ b/browser/base/content/test/general/browser_bug416661.js
@@ -17,22 +17,24 @@ function continue_test_prefNotSet () {
     is(ZoomManager.zoom, 1, "zoom level pref should not apply to an image");
     FullZoom.reset();
 
     yield FullZoomHelper.load(gBrowser.selectedTab, "http://mochi.test:8888/browser/browser/base/content/test/general/zoom_test.html");
   }).then(end_test_prefNotSet, FullZoomHelper.failAndContinue(finish));
 }
 
 function end_test_prefNotSet() {
-  is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted");
+  Task.spawn(function () {
+    is(ZoomManager.zoom, zoomLevel, "the zoom level should have persisted");
 
-  // Reset the zoom so that other tests have a fresh zoom level
-  FullZoom.reset();
-  gBrowser.removeCurrentTab();
-  finish();
+    // Reset the zoom so that other tests have a fresh zoom level
+    FullZoom.reset();
+    yield FullZoomHelper.removeTabAndWaitForLocationChange();
+    finish();
+  });
 }
 
 function test() {
   waitForExplicitFinish();
 
   Task.spawn(function () {
     tabElm = gBrowser.addTab();
     yield FullZoomHelper.selectTabAndWaitForLocationChange(tabElm);
--- a/browser/base/content/test/general/browser_bug419612.js
+++ b/browser/base/content/test/general/browser_bug419612.js
@@ -21,12 +21,12 @@ function test() {
     FullZoom.reset();
     gBrowser.selectedTab = tab1;
     tab1Zoom = ZoomManager.getZoomForBrowser(tab1.linkedBrowser);
     tab2Zoom = ZoomManager.getZoomForBrowser(tab2.linkedBrowser);
     isnot(tab1Zoom, tab2Zoom, "Zoom should not affect background tabs");
 
     if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
       gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
-    gBrowser.removeTab(tab1);
-    gBrowser.removeTab(tab2);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab1);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab2);
   }).then(finish, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/browser_bug441778.js
+++ b/browser/base/content/test/general/browser_bug441778.js
@@ -31,16 +31,16 @@ function test() {
     let deferred = Promise.defer();
     executeSoon(function () {
       testBrowser.addEventListener("load", function (e) {
         testBrowser.removeEventListener("load", arguments.callee, true);
 
         is(e.target.defaultView.location, TEST_IFRAME_URL, "got the load event for the iframe");
         is(ZoomManager.zoom, zoomLevel, "zoom is retained after sub-document load");
 
-        gBrowser.removeCurrentTab();
-        deferred.resolve();
+        FullZoomHelper.removeTabAndWaitForLocationChange().
+          then(() => deferred.resolve());
       }, true);
       content.document.querySelector("iframe").src = TEST_IFRAME_URL;
     });
     yield deferred.promise;
   }).then(finish, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/browser_bug555224.js
+++ b/browser/base/content/test/general/browser_bug555224.js
@@ -1,22 +1,24 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 const TEST_PAGE = "/browser/browser/base/content/test/general/dummy_page.html";
 var gTestTab, gBgTab, gTestZoom;
 
 function testBackgroundLoad() {
-  is(ZoomManager.zoom, gTestZoom, "opening a background tab should not change foreground zoom");
+  Task.spawn(function () {
+    is(ZoomManager.zoom, gTestZoom, "opening a background tab should not change foreground zoom");
 
-  gBrowser.removeTab(gBgTab);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gBgTab);
 
-  FullZoom.reset();
-  gBrowser.removeTab(gTestTab);
-  finish();
+    FullZoom.reset();
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTestTab);
+    finish();
+  });
 }
 
 function testInitialZoom() {
   Task.spawn(function () {
     is(ZoomManager.zoom, 1, "initial zoom level should be 1");
     FullZoom.enlarge();
 
     gTestZoom = ZoomManager.zoom;
--- a/browser/base/content/test/general/browser_bug559991.js
+++ b/browser/base/content/test/general/browser_bug559991.js
@@ -21,20 +21,22 @@ function test() {
     yield FullZoomHelper.selectTabAndWaitForLocationChange(tab);
     ok(true, "applyPrefToSetting was called");
   }).then(endTest, FullZoomHelper.failAndContinue(endTest));
 }
 
 // -------------
 // Test clean-up
 function endTest() {
-  gBrowser.removeTab(tab);
+  Task.spawn(function () {
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab);
 
-  tab = null;
+    tab = null;
 
-  if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
-    gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
+    if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
+      gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
 
-  if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific"))
-    gPrefService.clearUserPref("browser.zoom.siteSpecific");
+    if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific"))
+      gPrefService.clearUserPref("browser.zoom.siteSpecific");
 
-  finish();
+    finish();
+  });
 }
--- a/browser/base/content/test/general/browser_bug575830.js
+++ b/browser/base/content/test/general/browser_bug575830.js
@@ -3,20 +3,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 function test() {
   let tab1, tab2;
   const TEST_IMAGE = "http://example.org/browser/browser/base/content/test/general/moz.png";
 
   waitForExplicitFinish();
-  registerCleanupFunction(function cleanup() {
-    gBrowser.removeTab(tab1);
-    gBrowser.removeTab(tab2);
-  });
 
   Task.spawn(function () {
     tab1 = gBrowser.addTab();
     tab2 = gBrowser.addTab();
     yield FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
     yield FullZoomHelper.load(tab1, TEST_IMAGE);
 
     is(ZoomManager.zoom, 1, "initial zoom level for first should be 1");
@@ -25,10 +21,13 @@ function test() {
     let zoom = ZoomManager.zoom;
     isnot(zoom, 1, "zoom level should have changed");
 
     yield FullZoomHelper.selectTabAndWaitForLocationChange(tab2);
     is(ZoomManager.zoom, 1, "initial zoom level for second tab should be 1");
 
     yield FullZoomHelper.selectTabAndWaitForLocationChange(tab1);
     is(ZoomManager.zoom, zoom, "zoom level for first tab should not have changed");
+
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab1);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(tab2);
   }).then(finish, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/browser_bug719271.js
+++ b/browser/base/content/test/general/browser_bug719271.js
@@ -76,14 +76,14 @@ function waitForNextTurn() {
 var finishTestStarted  = false;
 function finishTest() {
   Task.spawn(function () {
     ok(!finishTestStarted, "finishTest called more than once");
     finishTestStarted = true;
 
     yield FullZoomHelper.selectTabAndWaitForLocationChange(gTab1);
     FullZoom.reset();
-    gBrowser.removeTab(gTab1);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTab1);
     yield FullZoomHelper.selectTabAndWaitForLocationChange(gTab2);
     FullZoom.reset();
-    gBrowser.removeTab(gTab2);
+    yield FullZoomHelper.removeTabAndWaitForLocationChange(gTab2);
   }).then(finish, FullZoomHelper.failAndContinue(finish));
 }
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -300,23 +300,35 @@ function promiseHistoryClearedState(aURI
   });
 
   return deferred.promise;
 }
 
 let FullZoomHelper = {
 
   selectTabAndWaitForLocationChange: function selectTabAndWaitForLocationChange(tab) {
+    if (!tab)
+      throw new Error("tab must be given.");
+    if (gBrowser.selectedTab == tab)
+      return Promise.resolve();
+    gBrowser.selectedTab = tab;
+    return this.waitForLocationChange();
+  },
+
+  removeTabAndWaitForLocationChange: function removeTabAndWaitForLocationChange(tab) {
+    tab = tab || gBrowser.selectedTab;
+    let selected = gBrowser.selectedTab == tab;
+    gBrowser.removeTab(tab);
+    if (selected)
+      return this.waitForLocationChange();
+    return Promise.resolve();
+  },
+
+  waitForLocationChange: function waitForLocationChange() {
     let deferred = Promise.defer();
-    if (tab && gBrowser.selectedTab == tab) {
-      deferred.resolve();
-      return deferred.promise;
-    }
-    if (tab)
-      gBrowser.selectedTab = tab;
     Services.obs.addObserver(function obs(subj, topic, data) {
       Services.obs.removeObserver(obs, topic);
       deferred.resolve();
     }, "FullZoom:TESTS:location-change", false);
     return deferred.promise;
   },
 
   load: function load(tab, url) {
@@ -326,17 +338,17 @@ let FullZoomHelper = {
 
     tab.linkedBrowser.addEventListener("load", function (event) {
       event.currentTarget.removeEventListener("load", arguments.callee, true);
       didLoad = true;
       if (didZoom)
         deferred.resolve();
     }, true);
 
-    this.selectTabAndWaitForLocationChange(null).then(function () {
+    this.waitForLocationChange().then(function () {
       didZoom = true;
       if (didLoad)
         deferred.resolve();
     });
 
     tab.linkedBrowser.loadURI(url);
 
     return deferred.promise;
@@ -378,17 +390,17 @@ let FullZoomHelper = {
         deferred.resolve();
     }, true);
 
     if (direction == this.BACK)
       gBrowser.goBack();
     else if (direction == this.FORWARD)
       gBrowser.goForward();
 
-    this.selectTabAndWaitForLocationChange(null).then(function () {
+    this.waitForLocationChange().then(function () {
       didZoom = true;
       if (didPs)
         deferred.resolve();
     });
     return deferred.promise;
   },
 
   failAndContinue: function failAndContinue(func) {