mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 941099 - Default application handler is not correctly used when an alternate app handler exists. r=paolo
This commit is contained in:
parent
66e008f703
commit
5b12e7ad40
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user