use of com.microsoft.identity.common.internal.ui.browser.BrowserDescriptor in project microsoft-authentication-library-common-for-android by AzureAD.
the class BrowserSelectorTest method testSelect_versionNotSupportedBrowser.
@Test
public void testSelect_versionNotSupportedBrowser() throws NameNotFoundException {
setBrowserList(CHROME, FIREFOX);
when(mContext.getPackageManager().resolveActivity(BROWSER_INTENT, 0)).thenReturn(CHROME.mResolveInfo);
List<BrowserDescriptor> browserSafelist = new ArrayList<>();
browserSafelist.add(new BrowserDescriptor("com.android.chrome", "ChromeSignature", "51", null));
try {
BrowserSelector.select(mContext, browserSafelist);
} catch (final ClientException exception) {
assertNotNull(exception);
assert (exception.getErrorCode().equalsIgnoreCase(ErrorStrings.NO_AVAILABLE_BROWSER_FOUND));
}
}
use of com.microsoft.identity.common.internal.ui.browser.BrowserDescriptor in project microsoft-authentication-library-common-for-android by AzureAD.
the class MsalBrokerRequestAdapter method getBrowserSafeListForBroker.
/**
* List of System Browsers which can be used from broker, currently only Chrome is supported.
* This information here is populated from the default browser safelist in MSAL.
*
* @return
*/
public static List<BrowserDescriptor> getBrowserSafeListForBroker() {
List<BrowserDescriptor> browserDescriptors = new ArrayList<>();
final HashSet<String> signatureHashes = new HashSet<String>();
signatureHashes.add("7fmduHKTdHHrlMvldlEqAIlSfii1tl35bxj1OXN5Ve8c4lU6URVu4xtSHc3BVZxS6WWJnxMDhIfQN0N0K2NDJg==");
final BrowserDescriptor chrome = new BrowserDescriptor("com.android.chrome", signatureHashes, null, null);
browserDescriptors.add(chrome);
return browserDescriptors;
}
Aggregations