Bug 633221 - Setting FF as default browser throws error when GIO Service is not available [r=roc, a=roc]

This commit is contained in:
Tim Taubert
2011-02-15 09:19:36 +01:00
parent 73b2a31593
commit c6c7ade378
3 changed files with 16 additions and 1 deletions

View File

@@ -230,7 +230,7 @@ nsGNOMEShellService::SetDefaultBrowser(PRBool aClaimAllTypes,
nsresult rv;
nsCOMPtr<nsIGIOService> giovfs =
do_GetService(NS_GIOSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_SUCCESS(rv, NS_OK);
nsCOMPtr<nsIStringBundleService> bundleService =
do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);

View File

@@ -48,6 +48,7 @@ XPCSHELL_TESTS = unit
include $(topsrcdir)/config/rules.mk
_BROWSER_TEST_FILES = browser_420786.js \
browser_633221.js \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)

View File

@@ -0,0 +1,14 @@
function test() {
let osString = Cc["@mozilla.org/xre/app-info;1"].
getService(Ci.nsIXULRuntime).OS;
// this test is Linux-specific
if (osString != "Linux")
return;
let shell = Cc["@mozilla.org/browser/shell-service;1"].
getService(Ci.nsIShellService);
shell.setDefaultBrowser(true, false);
ok(shell.isDefaultBrowser(true), "we got here and are the default browser");
}