Index: chrome/android/junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java |
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java |
index f9845e107e7e0eb97409548c83da8d2ce92d664a..1d5bfc3f456d29c2859a1e33bdc154e9d89146dd 100644 |
--- a/chrome/android/junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java |
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtilsTest.java |
@@ -18,8 +18,6 @@ import android.content.Context; |
import com.google.android.gms.common.ConnectionResult; |
-import org.chromium.base.test.util.Feature; |
-import org.chromium.testing.local.LocalRobolectricTestRunner; |
import org.junit.Before; |
import org.junit.Test; |
import org.junit.runner.RunWith; |
@@ -28,6 +26,9 @@ import org.mockito.Mock; |
import org.mockito.MockitoAnnotations; |
import org.robolectric.annotation.Config; |
+import org.chromium.base.test.util.Feature; |
+import org.chromium.testing.local.LocalRobolectricTestRunner; |
+ |
/** |
* Robolectric tests for {@link ExternalAuthUtils}. |
*/ |
@@ -48,7 +49,9 @@ public class ExternalAuthUtilsTest { |
@Feature({"GooglePlayServices"}) |
public void testCanUseGooglePlayServicesSuccess() { |
when(mExternalAuthUtils.canUseGooglePlayServices(any(Context.class), |
- any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
+ any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
+ when(mExternalAuthUtils.canUseGooglePlayServicesResultCode(any(Context.class), |
+ any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
when(mExternalAuthUtils.checkGooglePlayServicesAvailable(mContext)).thenReturn( |
ConnectionResult.SUCCESS); |
assertTrue(mExternalAuthUtils.canUseGooglePlayServices( |
@@ -69,7 +72,9 @@ public class ExternalAuthUtilsTest { |
@Feature({"GooglePlayServices"}) |
public void testCanUseGooglePlayServicesNonUserRecoverableFailure() { |
when(mExternalAuthUtils.canUseGooglePlayServices(any(Context.class), |
- any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
+ any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
+ when(mExternalAuthUtils.canUseGooglePlayServicesResultCode(any(Context.class), |
+ any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
when(mExternalAuthUtils.checkGooglePlayServicesAvailable(mContext)).thenReturn(ERR); |
when(mExternalAuthUtils.isUserRecoverableError(ERR)).thenReturn(false); // Non-recoverable |
assertFalse(mExternalAuthUtils.canUseGooglePlayServices( |
@@ -89,7 +94,9 @@ public class ExternalAuthUtilsTest { |
@Feature({"GooglePlayServices"}) |
public void testCanUseGooglePlayServicesUserRecoverableFailure() { |
when(mExternalAuthUtils.canUseGooglePlayServices(any(Context.class), |
- any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
+ any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
+ when(mExternalAuthUtils.canUseGooglePlayServicesResultCode(any(Context.class), |
+ any(UserRecoverableErrorHandler.class))).thenCallRealMethod(); |
doNothing().when(mUserRecoverableErrorHandler).handleError(mContext, ERR); |
when(mExternalAuthUtils.checkGooglePlayServicesAvailable(mContext)).thenReturn(ERR); |
when(mExternalAuthUtils.isUserRecoverableError(ERR)).thenReturn(true); // Recoverable |