diff --git a/library/java/net/openid/appauth/browser/BrowserSelector.java b/library/java/net/openid/appauth/browser/BrowserSelector.java index 5f2862fb..8a71fb67 100644 --- a/library/java/net/openid/appauth/browser/BrowserSelector.java +++ b/library/java/net/openid/appauth/browser/BrowserSelector.java @@ -180,9 +180,8 @@ private static boolean hasWarmupService(PackageManager pm, String packageName) { } private static boolean isFullBrowser(ResolveInfo resolveInfo) { - // The filter must match ACTION_VIEW, CATEGORY_BROWSEABLE, and at least one scheme, + // The filter must match ACTION_VIEW and at least one scheme, if (!resolveInfo.filter.hasAction(Intent.ACTION_VIEW) - || !resolveInfo.filter.hasCategory(Intent.CATEGORY_BROWSABLE) || resolveInfo.filter.schemesIterator() == null) { return false; } diff --git a/library/javatests/net/openid/appauth/browser/BrowserSelectorTest.java b/library/javatests/net/openid/appauth/browser/BrowserSelectorTest.java index 54fc9bb9..85699911 100644 --- a/library/javatests/net/openid/appauth/browser/BrowserSelectorTest.java +++ b/library/javatests/net/openid/appauth/browser/BrowserSelectorTest.java @@ -85,6 +85,15 @@ public class BrowserSelectorTest { .addSignature("DolphinSignature") .build(); + private static final TestBrowser OPERA = + new TestBrowserBuilder("com.opera.browser") + .addAction(Intent.ACTION_VIEW) + .addScheme(SCHEME_HTTP) + .addScheme(SCHEME_HTTPS) + .setVersion("50") + .addSignature("OperaSignature") + .build(); + private static final TestBrowser[] NO_BROWSERS = new TestBrowser[0]; @Mock Context mContext; @@ -147,18 +156,12 @@ public void testSelect_ignoreAuthorityRestrictedBrowsers() } @Test - public void testSelect_ignoreBrowsersWithoutBrowseableCategory() + public void testSelect_acceptBrowsersWithoutBrowseableCategory() throws NameNotFoundException { - TestBrowser misconfiguredBrowser = - new TestBrowserBuilder("com.broken.browser") - .addAction(Intent.ACTION_VIEW) - .addCategory(Intent.CATEGORY_DEFAULT) - .addScheme(SCHEME_HTTP) - .addScheme(SCHEME_HTTPS) - .build(); - setBrowserList(misconfiguredBrowser, CHROME); - setBrowsersWithWarmupSupport(misconfiguredBrowser, CHROME); - checkSelectedBrowser(CHROME, USE_CUSTOM_TAB); + // Opera browser does not expose Intent.CATEGORY_BROWSABLE + setBrowserList(OPERA); + setBrowsersWithWarmupSupport(OPERA); + checkSelectedBrowser(OPERA, USE_CUSTOM_TAB); } @Test