зеркало из https://github.com/mozilla/gecko-dev.git
Bug 941099 - Default application handler is not correctly used when an alternate app handler exists. r=paolo
This commit is contained in:
Родитель
708361ed09
Коммит
6f4dafcc2c
|
@ -200,7 +200,8 @@ DownloadLegacyTransfer.prototype = {
|
|||
contentType = aMIMEInfo.type;
|
||||
|
||||
let appHandler = aMIMEInfo.preferredApplicationHandler;
|
||||
if (appHandler instanceof Ci.nsILocalHandlerApp) {
|
||||
if (aMIMEInfo.preferredAction == Ci.nsIMIMEInfo.useHelperApp &&
|
||||
appHandler instanceof Ci.nsILocalHandlerApp) {
|
||||
launcherPath = appHandler.executable.path;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1521,6 +1521,7 @@ add_task(function test_launch() {
|
|||
source: httpUrl("source.txt"),
|
||||
target: getTempFile(TEST_TARGET_FILE_NAME).path,
|
||||
launcherPath: launcherPath,
|
||||
launchWhenSucceeded: true
|
||||
});
|
||||
|
||||
try {
|
||||
|
@ -1537,11 +1538,12 @@ add_task(function test_launch() {
|
|||
// it is created, thus we don't test calling "launch" before starting.
|
||||
download = yield promiseStartLegacyDownload(
|
||||
httpUrl("source.txt"),
|
||||
{ launcherPath: launcherPath });
|
||||
{ launcherPath: launcherPath,
|
||||
launchWhenSucceeded: true });
|
||||
yield promiseDownloadStopped(download);
|
||||
}
|
||||
|
||||
do_check_false(download.launchWhenSucceeded);
|
||||
do_check_true(download.launchWhenSucceeded);
|
||||
|
||||
DownloadIntegration._deferTestOpenFile = Promise.defer();
|
||||
download.launch();
|
||||
|
|
|
@ -341,6 +341,7 @@ function promiseStartLegacyDownload(aSourceUrl, aOptions) {
|
|||
localHandlerApp.executable = new FileUtils.File(aOptions.launcherPath);
|
||||
|
||||
mimeInfo.preferredApplicationHandler = localHandlerApp;
|
||||
mimeInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
|
||||
}
|
||||
|
||||
if (aOptions && aOptions.launchWhenSucceeded) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче