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/commandhandler.xpt
@BINPATH@/components/commandlines.xpt
@BINPATH@/components/compartments.xpt
@BINPATH@/components/composer.xpt
@BINPATH@/components/content_events.xpt
@BINPATH@/components/content_html.xpt

View File

@ -296,6 +296,7 @@ function SearchPref(event) {
}
}
let getAllPrefs; // Used by tests
function BuildUI() {
table = document.querySelector("table");
let trs = table.querySelectorAll("tr:not(#add-custom-preference)");
@ -307,7 +308,8 @@ function BuildUI() {
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++) {

View File

@ -292,7 +292,7 @@ let UI = {
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;
@ -303,8 +303,10 @@ let UI = {
let operationCanceled = e && e.canceled;
if (!operationCanceled) {
UI.reportError("error_operationFail", message);
if (e) {
console.error(e);
}
}
this.unbusy();
});
return promise;
@ -439,8 +441,13 @@ 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() {

View File

@ -93,12 +93,13 @@ let AppManager = exports.AppManager = {
},
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();
@ -354,18 +355,15 @@ let AppManager = exports.AppManager = {
} 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);
@ -386,6 +384,10 @@ let AppManager = exports.AppManager = {
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;

View File

@ -401,7 +401,7 @@ DeprecatedUSBRuntime.prototype = {
},
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";
@ -445,7 +445,7 @@ WiFiRuntime.prototype = {
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;
@ -474,7 +474,7 @@ SimulatorRuntime.prototype = {
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";
@ -520,7 +520,7 @@ let gRemoteRuntime = {
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");
@ -531,7 +531,7 @@ let gRemoteRuntime = {
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;

View File

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

View File

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

View File

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

View File

@ -175,6 +175,7 @@
@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

View File

@ -124,6 +124,7 @@
@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

View File

@ -2524,9 +2524,9 @@ nsDownloadManager::Observe(nsISupports *aSubject,
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;

View File

@ -40,7 +40,7 @@ const kStringsRequiringFormatting = {
quitCancelDownloadsAlertMsgMultiple: true,
quitCancelDownloadsAlertMsgMacMultiple: true,
offlineCancelDownloadsAlertMsgMultiple: true,
leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple: true
leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple2: true
};
////////////////////////////////////////////////////////////////////////////////
@ -232,9 +232,9 @@ this.DownloadPrompter.prototype = {
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;
}

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?
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.