Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
import com.microsoft.identity.common.java.ui.webview.authorization.IAuthorizationCompletionCallback;
import com.microsoft.identity.common.shadows.ShadowProcessUtil;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -159,6 +160,11 @@ public void onPageLoaded(final String url) {
}
}

@After
public void cleanUp(){
CommonFlightsManager.INSTANCE.resetFlightsManager();
}

@Test(expected = IllegalArgumentException.class)
public void testUrlOverrideHandlesEmptyString() {
assertTrue(mWebViewClient.shouldOverrideUrlLoading(mMockWebView, ""));
Expand Down Expand Up @@ -489,6 +495,11 @@ public void testOnReceivedSslError_Legacy() {
final SslError mockError = Mockito.mock(android.net.http.SslError.class);
final IAuthorizationCompletionCallback mockCallback = Mockito.mock(IAuthorizationCompletionCallback.class);
when(mockError.getUrl()).thenReturn("https://example.com");
final IFlightsManager mockFlightsManager = Mockito.mock(IFlightsManager.class);
final IFlightsProvider mockFlightsProvider = Mockito.mock(IFlightsProvider.class);
when(mockFlightsProvider.isFlightEnabled(eq(CommonFlight.SHOULD_PRESERVE_WEBVIEW_FLOW_ON_SSL_ERROR))).thenReturn(false);
when(mockFlightsManager.getFlightsProvider(anyLong())).thenReturn(mockFlightsProvider);
CommonFlightsManager.INSTANCE.initializeCommonFlightsManager(mockFlightsManager);
final AzureActiveDirectoryWebViewClient mockWebViewClient = new AzureActiveDirectoryWebViewClient(
mActivity,
mockCallback,
Expand Down