merge fx-team to mozilla-central a=merge

--HG--
extra : amend_source : ad69e43e431903e1bceb8026f9e864291e6627f1
This commit is contained in:
Carsten "Tomcat" Book 2015-01-16 14:56:23 +01:00
commit 1e2807f282
13 changed files with 45 additions and 31 deletions

View File

@ -139,6 +139,7 @@
@BINPATH@/components/chrome.xpt @BINPATH@/components/chrome.xpt
@BINPATH@/components/commandhandler.xpt @BINPATH@/components/commandhandler.xpt
@BINPATH@/components/commandlines.xpt @BINPATH@/components/commandlines.xpt
@BINPATH@/components/compartments.xpt
@BINPATH@/components/composer.xpt @BINPATH@/components/composer.xpt
@BINPATH@/components/content_events.xpt @BINPATH@/components/content_events.xpt
@BINPATH@/components/content_html.xpt @BINPATH@/components/content_html.xpt

View File

@ -296,6 +296,7 @@ function SearchPref(event) {
} }
} }
let getAllPrefs; // Used by tests
function BuildUI() { function BuildUI() {
table = document.querySelector("table"); table = document.querySelector("table");
let trs = table.querySelectorAll("tr:not(#add-custom-preference)"); let trs = table.querySelectorAll("tr:not(#add-custom-preference)");
@ -307,7 +308,8 @@ function BuildUI() {
if (AppManager.connection && if (AppManager.connection &&
AppManager.connection.status == Connection.Status.CONNECTED && AppManager.connection.status == Connection.Status.CONNECTED &&
AppManager.preferenceFront) { AppManager.preferenceFront) {
AppManager.preferenceFront.getAllPrefs().then(json => { getAllPrefs = AppManager.preferenceFront.getAllPrefs();
getAllPrefs.then(json => {
let devicePrefs = Object.keys(json); let devicePrefs = Object.keys(json);
devicePrefs.sort(); devicePrefs.sort();
for (let i = 0; i < devicePrefs.length; i++) { for (let i = 0; i < devicePrefs.length; i++) {

View File

@ -292,7 +292,7 @@ let UI = {
this.unbusy(); this.unbusy();
}, (e) => { }, (e) => {
let message; 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. // Some errors come from fronts that are not based on protocol.js.
// Errors are not translated to strings. // Errors are not translated to strings.
message = operationDescription + " (" + e.error + "): " + e.message; message = operationDescription + " (" + e.error + "): " + e.message;
@ -303,7 +303,9 @@ let UI = {
let operationCanceled = e && e.canceled; let operationCanceled = e && e.canceled;
if (!operationCanceled) { if (!operationCanceled) {
UI.reportError("error_operationFail", message); UI.reportError("error_operationFail", message);
console.error(e); if (e) {
console.error(e);
}
} }
this.unbusy(); this.unbusy();
}); });
@ -439,8 +441,13 @@ let UI = {
connectToRuntime: function(runtime) { connectToRuntime: function(runtime) {
let name = runtime.name; let name = runtime.name;
let promise = AppManager.connectToRuntime(runtime); let promise = AppManager.connectToRuntime(runtime);
promise.then(() => this.initConnectionTelemetry()); promise.then(() => this.initConnectionTelemetry())
return this.busyUntil(promise, "connecting to runtime " + name); .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() { updateRuntimeButton: function() {

View File

@ -93,12 +93,13 @@ let AppManager = exports.AppManager = {
}, },
onConnectionChanged: function() { onConnectionChanged: function() {
console.log("Connection status changed: " + this.connection.status);
if (this.connection.status == Connection.Status.DISCONNECTED) { if (this.connection.status == Connection.Status.DISCONNECTED) {
this.selectedRuntime = null; this.selectedRuntime = null;
} }
if (this.connection.status != Connection.Status.CONNECTED) { if (this.connection.status != Connection.Status.CONNECTED) {
console.log("Connection status changed: " + this.connection.status);
if (this._appsFront) { if (this._appsFront) {
this._appsFront.off("install-progress", this.onInstallProgress); this._appsFront.off("install-progress", this.onInstallProgress);
this._appsFront.unwatchApps(); this._appsFront.unwatchApps();
@ -354,18 +355,15 @@ let AppManager = exports.AppManager = {
} else { } else {
deferred.reject(); deferred.reject();
} }
} };
this.connection.on(Connection.Events.CONNECTED, onConnectedOrDisconnected); this.connection.on(Connection.Events.CONNECTED, onConnectedOrDisconnected);
this.connection.on(Connection.Events.DISCONNECTED, onConnectedOrDisconnected); this.connection.on(Connection.Events.DISCONNECTED, onConnectedOrDisconnected);
try { try {
// Reset the connection's state to defaults // Reset the connection's state to defaults
this.connection.resetOptions(); this.connection.resetOptions();
this.selectedRuntime.connect(this.connection).then( deferred.resolve(this.selectedRuntime.connect(this.connection));
() => {},
deferred.reject.bind(deferred));
} catch(e) { } catch(e) {
console.error(e); deferred.reject(e);
deferred.reject();
} }
}, deferred.reject); }, deferred.reject);
@ -386,6 +384,10 @@ let AppManager = exports.AppManager = {
this.connection.once(Connection.Events.STATUS_CHANGED, () => { this.connection.once(Connection.Events.STATUS_CHANGED, () => {
this._telemetry.stopTimer(timerId); 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; return deferred.promise;

View File

@ -401,7 +401,7 @@ DeprecatedUSBRuntime.prototype = {
}, },
connect: function(connection) { connect: function(connection) {
if (!this.device) { 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) => { return this.device.connect().then((port) => {
connection.host = "localhost"; connection.host = "localhost";
@ -445,7 +445,7 @@ WiFiRuntime.prototype = {
connect: function(connection) { connect: function(connection) {
let service = discovery.getRemoteService("devtools", this.deviceName); let service = discovery.getRemoteService("devtools", this.deviceName);
if (!service) { 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.host = service.host;
connection.port = service.port; connection.port = service.port;
@ -474,7 +474,7 @@ SimulatorRuntime.prototype = {
let port = ConnectionManager.getFreeTCPPort(); let port = ConnectionManager.getFreeTCPPort();
let simulator = Simulator.getByName(this.name); let simulator = Simulator.getByName(this.name);
if (!simulator || !simulator.launch) { 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(() => { return simulator.launch({port: port}).then(() => {
connection.host = "localhost"; connection.host = "localhost";
@ -520,7 +520,7 @@ let gRemoteRuntime = {
connect: function(connection) { connect: function(connection) {
let win = Services.wm.getMostRecentWindow("devtools:webide"); let win = Services.wm.getMostRecentWindow("devtools:webide");
if (!win) { if (!win) {
return promise.reject(); return promise.reject(new Error("No WebIDE window found"));
} }
let ret = {value: connection.host + ":" + connection.port}; let ret = {value: connection.host + ":" + connection.port};
let title = Strings.GetStringFromName("remote_runtime_promptTitle"); let title = Strings.GetStringFromName("remote_runtime_promptTitle");
@ -531,7 +531,7 @@ let gRemoteRuntime = {
return promise.reject({canceled: true}); return promise.reject({canceled: true});
} }
if (!host || !port) { if (!host || !port) {
return promise.reject(); return promise.reject(new Error("Invalid host or port"));
} }
connection.host = host; connection.host = host;
connection.port = port; connection.port = port;

View File

@ -46,6 +46,7 @@
win.Cmds.showDevicePrefs(); win.Cmds.showDevicePrefs();
is(deck.selectedPanel, prefIframe, "device preferences iframe selected"); is(deck.selectedPanel, prefIframe, "device preferences iframe selected");
yield prefIframe.contentWindow.getAllPrefs;
yield nextTick(); yield nextTick();
let doc = prefIframe.contentWindow.document; let doc = prefIframe.contentWindow.document;

View File

@ -49,7 +49,7 @@
win.Cmds.showRuntimeDetails(); win.Cmds.showRuntimeDetails();
is(deck.selectedPanel, infoIframe, "info iframe selected"); is(deck.selectedPanel, infoIframe, "info iframe selected");
yield infoIframe.contentWindow.getRawPermissionsTablePromise; yield infoIframe.contentWindow.getDescriptionPromise;
yield nextTick(); yield nextTick();
@ -72,7 +72,7 @@
win.Cmds.showPermissionsTable(); win.Cmds.showPermissionsTable();
is(deck.selectedPanel, permIframe, "permission iframe selected"); is(deck.selectedPanel, permIframe, "permission iframe selected");
yield infoIframe.contentWindow.getDescriptionPromise; yield permIframe.contentWindow.getRawPermissionsTablePromise;
yield nextTick(); yield nextTick();

View File

@ -143,7 +143,7 @@
function connectToRuntime(win, type, index) { function connectToRuntime(win, type, index) {
return Task.spawn(function*() { return Task.spawn(function*() {
yield startConnection(win, type, index); startConnection(win, type, index);
yield waitUntilConnected(win); yield waitUntilConnected(win);
}); });
} }

View File

@ -175,6 +175,7 @@
@RESPATH@/components/chrome.xpt @RESPATH@/components/chrome.xpt
@RESPATH@/components/commandhandler.xpt @RESPATH@/components/commandhandler.xpt
@RESPATH@/components/commandlines.xpt @RESPATH@/components/commandlines.xpt
@RESPATH@/components/compartments.xpt
@RESPATH@/components/composer.xpt @RESPATH@/components/composer.xpt
@RESPATH@/components/content_events.xpt @RESPATH@/components/content_events.xpt
@RESPATH@/components/content_html.xpt @RESPATH@/components/content_html.xpt

View File

@ -124,6 +124,7 @@
@BINPATH@/components/chrome.xpt @BINPATH@/components/chrome.xpt
@BINPATH@/components/commandhandler.xpt @BINPATH@/components/commandhandler.xpt
@BINPATH@/components/commandlines.xpt @BINPATH@/components/commandlines.xpt
@BINPATH@/components/compartments.xpt
@BINPATH@/components/composer.xpt @BINPATH@/components/composer.xpt
@BINPATH@/components/content_events.xpt @BINPATH@/components/content_events.xpt
@BINPATH@/components/content_geckomediaplugins.xpt @BINPATH@/components/content_geckomediaplugins.xpt

View File

@ -2524,9 +2524,9 @@ nsDownloadManager::Observe(nsISupports *aSubject,
ConfirmCancelDownloads(mCurrentPrivateDownloads.Count(), cancelDownloads, ConfirmCancelDownloads(mCurrentPrivateDownloads.Count(), cancelDownloads,
MOZ_UTF16("leavePrivateBrowsingCancelDownloadsAlertTitle"), MOZ_UTF16("leavePrivateBrowsingCancelDownloadsAlertTitle"),
MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple"), MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2"),
MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsg"), MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2"),
MOZ_UTF16("dontLeavePrivateBrowsingButton")); MOZ_UTF16("dontLeavePrivateBrowsingButton2"));
} }
return NS_OK; return NS_OK;

View File

@ -40,7 +40,7 @@ const kStringsRequiringFormatting = {
quitCancelDownloadsAlertMsgMultiple: true, quitCancelDownloadsAlertMsgMultiple: true,
quitCancelDownloadsAlertMsgMacMultiple: true, quitCancelDownloadsAlertMsgMacMultiple: true,
offlineCancelDownloadsAlertMsgMultiple: true, offlineCancelDownloadsAlertMsgMultiple: true,
leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple: true leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2: true
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -232,9 +232,9 @@ this.DownloadPrompter.prototype = {
case this.ON_LEAVE_PRIVATE_BROWSING: case this.ON_LEAVE_PRIVATE_BROWSING:
title = s.leavePrivateBrowsingCancelDownloadsAlertTitle; title = s.leavePrivateBrowsingCancelDownloadsAlertTitle;
message = aDownloadsCount > 1 message = aDownloadsCount > 1
? s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple(aDownloadsCount) ? s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2(aDownloadsCount)
: s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsg; : s.leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2;
cancelButton = s.dontLeavePrivateBrowsingButton; cancelButton = s.dontLeavePrivateBrowsingButton2;
break; break;
} }

View File

@ -32,15 +32,14 @@ offlineCancelDownloadsAlertTitle=Cancel All Downloads?
offlineCancelDownloadsAlertMsg=If you go offline now, 1 download will be canceled. Are you sure you want to go offline? 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? offlineCancelDownloadsAlertMsgMultiple=If you go offline now, %S downloads will be canceled. Are you sure you want to go offline?
leavePrivateBrowsingCancelDownloadsAlertTitle=Cancel All Downloads? 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? leavePrivateBrowsingWindowsCancelDownloadsAlertMsg2=If you close all Private Browsing windows now, 1 download will be canceled. Are you sure you want to leave Private Browsing?
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? 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 cancelDownloadsOKText=Cancel 1 Download
cancelDownloadsOKTextMultiple=Cancel %S Downloads cancelDownloadsOKTextMultiple=Cancel %S Downloads
dontQuitButtonWin=Don't Exit dontQuitButtonWin=Don't Exit
dontQuitButtonMac=Don't Quit dontQuitButtonMac=Don't Quit
dontGoOfflineButton=Stay Online dontGoOfflineButton=Stay Online
dontEnterPrivateBrowsingButton=Don't Enter the Private Browsing Mode dontLeavePrivateBrowsingButton2=Stay in Private Browsing
dontLeavePrivateBrowsingButton=Stay in Private Browsing Mode
downloadsCompleteTitle=Downloads Complete downloadsCompleteTitle=Downloads Complete
downloadsCompleteMsg=All files have finished downloading. downloadsCompleteMsg=All files have finished downloading.