зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1416254 - Remove conditional catch consumers in uriloader/. r=mak
This commit is contained in:
Родитель
cbd4fe279b
Коммит
4c6f4eda25
|
@ -16,8 +16,11 @@ function run_test() {
|
|||
var type = Cc["@mozilla.org/mime;1"].
|
||||
getService(Ci.nsIMIMEService).
|
||||
getFromTypeAndExtension(badMimeType, "txt");
|
||||
} catch (e if (e instanceof Ci.nsIException &&
|
||||
e.result == Cr.NS_ERROR_NOT_AVAILABLE)) {
|
||||
} catch (e) {
|
||||
if (!(e instanceof Ci.nsIException) ||
|
||||
e.result != Cr.NS_ERROR_NOT_AVAILABLE) {
|
||||
throw e;
|
||||
}
|
||||
// This is an expected exception, thrown if the type can't be determined
|
||||
} finally {
|
||||
}
|
||||
|
|
|
@ -30,8 +30,11 @@ function run_test() {
|
|||
mimeService.getTypeFromExtension(kTestExtension);
|
||||
// The line above should have thrown an exception.
|
||||
do_throw("nsIMIMEService.getTypeFromExtension succeeded unexpectedly");
|
||||
} catch (e if (e instanceof Ci.nsIException &&
|
||||
e.result == Cr.NS_ERROR_NOT_AVAILABLE)) {
|
||||
} catch (e) {
|
||||
if (!(e instanceof Ci.nsIException) ||
|
||||
e.result != Cr.NS_ERROR_NOT_AVAILABLE) {
|
||||
throw e;
|
||||
}
|
||||
// This is an expected exception, thrown if the type can't be determined.
|
||||
// Any other exception would cause the test to fail.
|
||||
}
|
||||
|
|
|
@ -174,8 +174,11 @@ function run_test() {
|
|||
var type = Cc["@mozilla.org/mime;1"].
|
||||
getService(Ci.nsIMIMEService).
|
||||
getTypeFromExtension(".txt");
|
||||
} catch (e if (e instanceof Ci.nsIException &&
|
||||
e.result == Cr.NS_ERROR_NOT_AVAILABLE)) {
|
||||
} catch (e) {
|
||||
if (!(e instanceof Ci.nsIException) ||
|
||||
e.result != Cr.NS_ERROR_NOT_AVAILABLE) {
|
||||
throw e;
|
||||
}
|
||||
// This is an expected exception, thrown if the type can't be determined
|
||||
} finally {
|
||||
// Ensure we restore the original factory when the test is finished
|
||||
|
|
Загрузка…
Ссылка в новой задаче