merge fx-team to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 16 Jan 2015 14:56:23 +0100
changeset 224179 b93bbdaf7980f4b21855dd6c0c5fd74803a94433
parent 224149 47b586de56613cd97e2a380a769c41ab155fd4e3 (current diff)
parent 224178 896e9c313511044a7ae0c5239f4884e547b72752 (diff)
child 224200 5438e3f7484802510eaff28a1364e97f492fae61
push id54150
push usercbook@mozilla.com
push dateFri, 16 Jan 2015 14:14:56 +0000
treeherdermozilla-inbound@ac6623427298 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone38.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 fx-team to mozilla-central a=merge
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -134,16 +134,17 @@
 @BINPATH@/components/browsercompsbase.xpt
 @BINPATH@/components/browser-element.xpt
 @BINPATH@/components/browser-feeds.xpt
 @BINPATH@/components/caps.xpt
 @BINPATH@/components/chardet.xpt
 @BINPATH@/components/chrome.xpt
 @BINPATH@/components/commandhandler.xpt
 @BINPATH@/components/commandlines.xpt
+@BINPATH@/components/compartments.xpt
 @BINPATH@/components/composer.xpt
 @BINPATH@/components/content_events.xpt
 @BINPATH@/components/content_html.xpt
 @BINPATH@/components/content_xslt.xpt
 @BINPATH@/components/cookie.xpt
 @BINPATH@/components/devtools_security.xpt
 @BINPATH@/components/directory.xpt
 @BINPATH@/components/diskspacewatcher.xpt
--- a/browser/devtools/webide/content/devicepreferences.js
+++ b/browser/devtools/webide/content/devicepreferences.js
@@ -291,28 +291,30 @@ function SearchPref(event) {
     var trs = document.getElementsByTagName("tr");
 
     for (let i = 0; i < trs.length; i++) {
       trs[i].classList.remove("hide");
     }
   }
 }
 
+let getAllPrefs; // Used by tests
 function BuildUI() {
   table = document.querySelector("table");
   let trs = table.querySelectorAll("tr:not(#add-custom-preference)");
 
   for (var i = 0; i < trs.length; i++) {
     table.removeChild(trs[i]);
   }
 
   if (AppManager.connection &&
       AppManager.connection.status == Connection.Status.CONNECTED &&
       AppManager.preferenceFront) {
-    AppManager.preferenceFront.getAllPrefs().then(json => {
+    getAllPrefs = AppManager.preferenceFront.getAllPrefs();
+    getAllPrefs.then(json => {
       let devicePrefs = Object.keys(json);
       devicePrefs.sort();
       for (let i = 0; i < devicePrefs.length; i++) {
         GenerateField(devicePrefs[i], json[devicePrefs[i]].value, json[devicePrefs[i]].hasUserValue);
       }
     });
   } else {
     CloseUI();
--- a/browser/devtools/webide/content/webide.js
+++ b/browser/devtools/webide/content/webide.js
@@ -287,28 +287,30 @@ let UI = {
     this._busyOperationDescription = operationDescription;
     this.setupBusyTimeout();
     this.busy();
     promise.then(() => {
       this.cancelBusyTimeout();
       this.unbusy();
     }, (e) => {
       let message;
-      if (e.error && e.message) {
+      if (e && e.error && e.message) {
         // Some errors come from fronts that are not based on protocol.js.
         // Errors are not translated to strings.
         message = operationDescription + " (" + e.error + "): " + e.message;
       } else {
         message = operationDescription + (e ? (": " + e) : "");
       }
       this.cancelBusyTimeout();
       let operationCanceled = e && e.canceled;
       if (!operationCanceled) {
         UI.reportError("error_operationFail", message);
-        console.error(e);
+        if (e) {
+          console.error(e);
+        }
       }
       this.unbusy();
     });
     return promise;
   },
 
   reportError: function(l10nProperty, ...l10nArgs) {
     let text;
@@ -434,18 +436,23 @@ let UI = {
         }
       }
     }
   },
 
   connectToRuntime: function(runtime) {
     let name = runtime.name;
     let promise = AppManager.connectToRuntime(runtime);
-    promise.then(() => this.initConnectionTelemetry());
-    return this.busyUntil(promise, "connecting to runtime " + name);
+    promise.then(() => this.initConnectionTelemetry())
+           .catch(() => {
+             // Empty rejection handler to silence uncaught rejection warnings
+             // |busyUntil| will listen for rejections.
+             // Bug 1121100 may find a better way to silence these.
+           });
+    return this.busyUntil(promise, "Connecting to " + name);
   },
 
   updateRuntimeButton: function() {
     let labelNode = document.querySelector("#runtime-panel-button > .panel-button-label");
     if (!AppManager.selectedRuntime) {
       labelNode.setAttribute("value", Strings.GetStringFromName("runtimeButton_label"));
     } else {
       let name = AppManager.selectedRuntime.name;
--- a/browser/devtools/webide/modules/app-manager.js
+++ b/browser/devtools/webide/modules/app-manager.js
@@ -88,22 +88,23 @@ let AppManager = exports.AppManager = {
       } else {
         text = Strings.GetStringFromName(l10nProperty);
       }
       console.error(text);
     }
   },
 
   onConnectionChanged: function() {
+    console.log("Connection status changed: " + this.connection.status);
+
     if (this.connection.status == Connection.Status.DISCONNECTED) {
       this.selectedRuntime = null;
     }
 
     if (this.connection.status != Connection.Status.CONNECTED) {
-      console.log("Connection status changed: " + this.connection.status);
       if (this._appsFront) {
         this._appsFront.off("install-progress", this.onInstallProgress);
         this._appsFront.unwatchApps();
         this._appsFront = null;
       }
       this._listTabsResponse = null;
     } else {
       this.connection.client.listTabs((response) => {
@@ -349,28 +350,25 @@ let AppManager = exports.AppManager = {
       let onConnectedOrDisconnected = () => {
         this.connection.off(Connection.Events.CONNECTED, onConnectedOrDisconnected);
         this.connection.off(Connection.Events.DISCONNECTED, onConnectedOrDisconnected);
         if (this.connection.status == Connection.Status.CONNECTED) {
           deferred.resolve();
         } else {
           deferred.reject();
         }
-      }
+      };
       this.connection.on(Connection.Events.CONNECTED, onConnectedOrDisconnected);
       this.connection.on(Connection.Events.DISCONNECTED, onConnectedOrDisconnected);
       try {
         // Reset the connection's state to defaults
         this.connection.resetOptions();
-        this.selectedRuntime.connect(this.connection).then(
-          () => {},
-          deferred.reject.bind(deferred));
+        deferred.resolve(this.selectedRuntime.connect(this.connection));
       } catch(e) {
-        console.error(e);
-        deferred.reject();
+        deferred.reject(e);
       }
     }, deferred.reject);
 
     // Record connection result in telemetry
     let logResult = result => {
       this._telemetry.log("DEVTOOLS_WEBIDE_CONNECTION_RESULT", result);
       if (runtime.type) {
         this._telemetry.log("DEVTOOLS_WEBIDE_" + runtime.type +
@@ -381,16 +379,20 @@ let AppManager = exports.AppManager = {
 
     // If successful, record connection time in telemetry
     deferred.promise.then(() => {
       const timerId = "DEVTOOLS_WEBIDE_CONNECTION_TIME_SECONDS";
       this._telemetry.startTimer(timerId);
       this.connection.once(Connection.Events.STATUS_CHANGED, () => {
         this._telemetry.stopTimer(timerId);
       });
+    }).catch(() => {
+      // Empty rejection handler to silence uncaught rejection warnings
+      // |connectToRuntime| caller should listen for rejections.
+      // Bug 1121100 may find a better way to silence these.
     });
 
     return deferred.promise;
   },
 
   isMainProcessDebuggable: function() {
     return this._listTabsResponse &&
            this._listTabsResponse.consoleActor;
--- a/browser/devtools/webide/modules/runtimes.js
+++ b/browser/devtools/webide/modules/runtimes.js
@@ -396,17 +396,17 @@ function DeprecatedUSBRuntime(id) {
 
 DeprecatedUSBRuntime.prototype = {
   type: RuntimeTypes.USB,
   get device() {
     return Devices.getByName(this._id);
   },
   connect: function(connection) {
     if (!this.device) {
-      return promise.reject("Can't find device: " + this.name);
+      return promise.reject(new Error("Can't find device: " + this.name));
     }
     return this.device.connect().then((port) => {
       connection.host = "localhost";
       connection.port = port;
       connection.connect();
     });
   },
   get id() {
@@ -440,17 +440,17 @@ function WiFiRuntime(deviceName) {
   this.deviceName = deviceName;
 }
 
 WiFiRuntime.prototype = {
   type: RuntimeTypes.WIFI,
   connect: function(connection) {
     let service = discovery.getRemoteService("devtools", this.deviceName);
     if (!service) {
-      return promise.reject("Can't find device: " + this.name);
+      return promise.reject(new Error("Can't find device: " + this.name));
     }
     connection.host = service.host;
     connection.port = service.port;
     connection.encryption = service.encryption;
     connection.connect();
     return promise.resolve();
   },
   get id() {
@@ -469,17 +469,17 @@ function SimulatorRuntime(name) {
 }
 
 SimulatorRuntime.prototype = {
   type: RuntimeTypes.SIMULATOR,
   connect: function(connection) {
     let port = ConnectionManager.getFreeTCPPort();
     let simulator = Simulator.getByName(this.name);
     if (!simulator || !simulator.launch) {
-      return promise.reject("Can't find simulator: " + this.name);
+      return promise.reject(new Error("Can't find simulator: " + this.name));
     }
     return simulator.launch({port: port}).then(() => {
       connection.host = "localhost";
       connection.port = port;
       connection.keepConnecting = true;
       connection.once(Connection.Events.DISCONNECTED, simulator.close);
       connection.connect();
     });
@@ -515,28 +515,28 @@ let gLocalRuntime = {
 // For testing use only
 exports._gLocalRuntime = gLocalRuntime;
 
 let gRemoteRuntime = {
   type: RuntimeTypes.REMOTE,
   connect: function(connection) {
     let win = Services.wm.getMostRecentWindow("devtools:webide");
     if (!win) {
-      return promise.reject();
+      return promise.reject(new Error("No WebIDE window found"));
     }
     let ret = {value: connection.host + ":" + connection.port};
     let title = Strings.GetStringFromName("remote_runtime_promptTitle");
     let message = Strings.GetStringFromName("remote_runtime_promptMessage");
     let ok = Services.prompt.prompt(win, title, message, ret, null, {});
     let [host,port] = ret.value.split(":");
     if (!ok) {
       return promise.reject({canceled: true});
     }
     if (!host || !port) {
-      return promise.reject();
+      return promise.reject(new Error("Invalid host or port"));
     }
     connection.host = host;
     connection.port = port;
     connection.connect();
     return promise.resolve();
   },
   get name() {
     return Strings.GetStringFromName("remote_runtime");
--- a/browser/devtools/webide/test/test_device_preferences.html
+++ b/browser/devtools/webide/test/test_device_preferences.html
@@ -41,16 +41,17 @@
 
           ok(!prefs.hasAttribute("disabled"), "device prefs cmd enabled");
 
           let deck = win.document.querySelector("#deck");
 
           win.Cmds.showDevicePrefs();
           is(deck.selectedPanel, prefIframe, "device preferences iframe selected");
 
+          yield prefIframe.contentWindow.getAllPrefs;
           yield nextTick();
 
           let doc = prefIframe.contentWindow.document;
           let fields = doc.querySelectorAll(".editable");
           let preference = "accessibility.blockautorefresh";
           let found = false;
 
           // Trigger existing field change
--- a/browser/devtools/webide/test/test_deviceinfo.html
+++ b/browser/devtools/webide/test/test_deviceinfo.html
@@ -44,17 +44,17 @@
           ok(!perm.hasAttribute("disabled"), "perm cmd enabled");
           ok(!info.hasAttribute("disabled"), "info cmd enabled");
 
           let deck = win.document.querySelector("#deck");
 
           win.Cmds.showRuntimeDetails();
           is(deck.selectedPanel, infoIframe, "info iframe selected");
 
-          yield infoIframe.contentWindow.getRawPermissionsTablePromise;
+          yield infoIframe.contentWindow.getDescriptionPromise;
 
           yield nextTick();
 
           // device info and permissions content is checked in other tests
           // We just test one value to make sure we get something
 
           let doc = infoIframe.contentWindow.document;
           let trs = doc.querySelectorAll("tr");
@@ -67,17 +67,17 @@
               is(val.textContent, Services.appinfo.ID, "appid has the right value");
             }
           }
           ok(found, "Found appid line");
 
           win.Cmds.showPermissionsTable();
           is(deck.selectedPanel, permIframe, "permission iframe selected");
 
-          yield infoIframe.contentWindow.getDescriptionPromise;
+          yield permIframe.contentWindow.getRawPermissionsTablePromise;
 
           yield nextTick();
 
           doc = permIframe.contentWindow.document;
           trs = doc.querySelectorAll(".line");
           found = false;
           for (let tr of trs) {
             let [name,v1,v2,v3] = tr.querySelectorAll("td");
--- a/browser/devtools/webide/test/test_telemetry.html
+++ b/browser/devtools/webide/test/test_telemetry.html
@@ -138,17 +138,17 @@
           ok(win.document.querySelector("window").className, "busy", "UI is busy");
           yield win.UI._busyPromise;
           is(Object.keys(DebuggerServer._connections).length, 1, "Connected");
         });
       }
 
       function connectToRuntime(win, type, index) {
         return Task.spawn(function*() {
-          yield startConnection(win, type, index);
+          startConnection(win, type, index);
           yield waitUntilConnected(win);
         });
       }
 
       function checkResults() {
         let result = Telemetry.prototype.telemetryInfo;
         for (let [histId, value] of Iterator(result)) {
           if (histId.endsWith("OPENED_PER_USER_FLAG")) {
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -170,16 +170,17 @@
 @RESPATH@/components/browser-element.xpt
 @RESPATH@/browser/components/browsercompsbase.xpt
 @RESPATH@/browser/components/browser-feeds.xpt
 @RESPATH@/browser/components/browsermodules.manifest
 @RESPATH@/components/caps.xpt
 @RESPATH@/components/chrome.xpt
 @RESPATH@/components/commandhandler.xpt
 @RESPATH@/components/commandlines.xpt
+@RESPATH@/components/compartments.xpt
 @RESPATH@/components/composer.xpt
 @RESPATH@/components/content_events.xpt
 @RESPATH@/components/content_html.xpt
 @RESPATH@/components/content_geckomediaplugins.xpt
 #ifdef MOZ_WEBRTC
 @RESPATH@/components/content_webrtc.xpt
 #endif
 @RESPATH@/components/content_xslt.xpt
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -119,16 +119,17 @@
 @BINPATH@/components/browsercompsbase.xpt
 @BINPATH@/components/browser-element.xpt
 @BINPATH@/components/browser-feeds.xpt
 @BINPATH@/components/caps.xpt
 @BINPATH@/components/chardet.xpt
 @BINPATH@/components/chrome.xpt
 @BINPATH@/components/commandhandler.xpt
 @BINPATH@/components/commandlines.xpt
+@BINPATH@/components/compartments.xpt
 @BINPATH@/components/composer.xpt
 @BINPATH@/components/content_events.xpt
 @BINPATH@/components/content_geckomediaplugins.xpt
 @BINPATH@/components/content_html.xpt
 @BINPATH@/components/content_webrtc.xpt
 @BINPATH@/components/content_xslt.xpt
 @BINPATH@/components/cookie.xpt
 @BINPATH@/components/directory.xpt
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -2519,19 +2519,19 @@ nsDownloadManager::Observe(nsISupports *
     if (!mCurrentPrivateDownloads.Count())
       return NS_OK;
 
     nsCOMPtr<nsISupportsPRBool> cancelDownloads = do_QueryInterface(aSubject, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     ConfirmCancelDownloads(mCurrentPrivateDownloads.Count(), cancelDownloads,
                            MOZ_UTF16("leavePrivateBrowsingCancelDownloadsAlertTitle"),
-                           MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple"),
-                           MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsg"),
-                           MOZ_UTF16("dontLeavePrivateBrowsingButton"));
+                           MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2"),
+                           MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2"),
+                           MOZ_UTF16("dontLeavePrivateBrowsingButton2"));
   }
 
   return NS_OK;
 }
 
 void
 nsDownloadManager::ConfirmCancelDownloads(int32_t aCount,
                                           nsISupportsPRBool *aCancelDownloads,
--- a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
@@ -35,17 +35,17 @@ const kStringBundleUrl =
   "chrome://mozapps/locale/downloads/downloads.properties";
 
 const kStringsRequiringFormatting = {
   fileExecutableSecurityWarning: true,
   cancelDownloadsOKTextMultiple: true,
   quitCancelDownloadsAlertMsgMultiple: true,
   quitCancelDownloadsAlertMsgMacMultiple: true,
   offlineCancelDownloadsAlertMsgMultiple: true,
-  leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple: true
+  leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2: true
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 //// DownloadUIHelper
 
 /**
  * Provides functions to handle status and messages in the user interface.
  */
@@ -227,19 +227,19 @@ this.DownloadPrompter.prototype = {
         message = aDownloadsCount > 1
                   ? s.offlineCancelDownloadsAlertMsgMultiple(aDownloadsCount)
                   : s.offlineCancelDownloadsAlertMsg;
         cancelButton = s.dontGoOfflineButton;
         break;
       case this.ON_LEAVE_PRIVATE_BROWSING:
         title = s.leavePrivateBrowsingCancelDownloadsAlertTitle;
         message = aDownloadsCount > 1
-                  ? s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple(aDownloadsCount)
-                  : s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsg;
-        cancelButton = s.dontLeavePrivateBrowsingButton;
+                  ? s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2(aDownloadsCount)
+                  : s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2;
+        cancelButton = s.dontLeavePrivateBrowsingButton2;
         break;
     }
 
     let rv = this._prompter.confirmEx(title, message, buttonFlags, okButton,
                                       cancelButton, null, null, {});
     return (rv == 1);
   }
 };
--- a/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties
+++ b/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties
@@ -27,25 +27,24 @@ quitCancelDownloadsAlertTitle=Cancel All
 quitCancelDownloadsAlertMsg=If you exit now, 1 download will be canceled. Are you sure you want to exit?
 quitCancelDownloadsAlertMsgMultiple=If you exit now, %S downloads will be canceled. Are you sure you want to exit?
 quitCancelDownloadsAlertMsgMac=If you quit now, 1 download will be canceled. Are you sure you want to quit?
 quitCancelDownloadsAlertMsgMacMultiple=If you quit now, %S downloads will be canceled. Are you sure you want to quit?
 offlineCancelDownloadsAlertTitle=Cancel All Downloads?
 offlineCancelDownloadsAlertMsg=If you go offline now, 1 download will be canceled. Are you sure you want to go offline?
 offlineCancelDownloadsAlertMsgMultiple=If you go offline now, %S downloads will be canceled. Are you sure you want to go offline?
 leavePrivateBrowsingCancelDownloadsAlertTitle=Cancel All Downloads?
-leavePrivateBrowsingWindowsCancelDownloadsAlertMsg=If you close all Private Browsing windows now, 1 download will be canceled. Are you sure you want to leave the Private Browsing mode?
-leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple=If you close all Private Browsing windows now, %S downloads will be canceled. Are you sure you want to leave the Private Browsing mode?
+leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2=If you close all Private Browsing windows now, 1 download will be canceled. Are you sure you want to leave Private Browsing?
+leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2=If you close all Private Browsing windows now, %S downloads will be canceled. Are you sure you want to leave Private Browsing?
 cancelDownloadsOKText=Cancel 1 Download
 cancelDownloadsOKTextMultiple=Cancel %S Downloads
 dontQuitButtonWin=Don't Exit
 dontQuitButtonMac=Don't Quit
 dontGoOfflineButton=Stay Online
-dontEnterPrivateBrowsingButton=Don't Enter the Private Browsing Mode
-dontLeavePrivateBrowsingButton=Stay in Private Browsing Mode
+dontLeavePrivateBrowsingButton2=Stay in Private Browsing
 downloadsCompleteTitle=Downloads Complete
 downloadsCompleteMsg=All files have finished downloading. 
 
 # LOCALIZATION NOTE (infiniteRate):
 # If download speed is a JavaScript Infinity value, this phrase is used
 infiniteRate=Really fast
 
 # LOCALIZATION NOTE (statusFormat3): — is the "em dash" (long dash)