Loading tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java +0 −20 Original line number Diff line number Diff line Loading @@ -466,22 +466,10 @@ public class TelecomServiceImplTest extends TelecomTestCase { if (shouldSucceed) { assertFalse(didExceptionOccur); verify(mFakePhoneAccountRegistrar).registerPhoneAccount(testPhoneAccount); verify(mContext).sendBroadcastAsUser(intentCaptor.capture(), eq(UserHandle.ALL), anyString()); Intent capturedIntent = intentCaptor.getValue(); assertEquals(TelecomManager.ACTION_PHONE_ACCOUNT_REGISTERED, capturedIntent.getAction()); Bundle intentExtras = capturedIntent.getExtras(); assertEquals(1, intentExtras.size()); assertEquals(testPhoneAccount.getAccountHandle(), intentExtras.get(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE)); } else { assertTrue(didExceptionOccur); verify(mFakePhoneAccountRegistrar, never()) .registerPhoneAccount(any(PhoneAccount.class)); verify(mContext, never()) .sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), anyString()); } } Loading @@ -497,14 +485,6 @@ public class TelecomServiceImplTest extends TelecomTestCase { mTSIBinder.unregisterPhoneAccount(phHandle); verify(mFakePhoneAccountRegistrar).unregisterPhoneAccount(phHandle); verify(mContext).sendBroadcastAsUser(intentCaptor.capture(), eq(UserHandle.ALL), anyString()); Intent capturedIntent = intentCaptor.getValue(); assertEquals(TelecomManager.ACTION_PHONE_ACCOUNT_UNREGISTERED, capturedIntent.getAction()); Bundle intentExtras = capturedIntent.getExtras(); assertEquals(1, intentExtras.size()); assertEquals(phHandle, intentExtras.get(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE)); } @SmallTest Loading tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isNull; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; Loading Loading @@ -311,6 +312,7 @@ public class TelecomSystemTest extends TelecomTestCase { super.setUp(); mSpyContext = mComponentContextFixture.getTestDouble().getApplicationContext(); doReturn(mSpyContext).when(mSpyContext).getApplicationContext(); doNothing().when(mSpyContext).sendBroadcastAsUser(any(), any(), any()); mNumOutgoingCallsMade = 0; Loading Loading
tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java +0 −20 Original line number Diff line number Diff line Loading @@ -466,22 +466,10 @@ public class TelecomServiceImplTest extends TelecomTestCase { if (shouldSucceed) { assertFalse(didExceptionOccur); verify(mFakePhoneAccountRegistrar).registerPhoneAccount(testPhoneAccount); verify(mContext).sendBroadcastAsUser(intentCaptor.capture(), eq(UserHandle.ALL), anyString()); Intent capturedIntent = intentCaptor.getValue(); assertEquals(TelecomManager.ACTION_PHONE_ACCOUNT_REGISTERED, capturedIntent.getAction()); Bundle intentExtras = capturedIntent.getExtras(); assertEquals(1, intentExtras.size()); assertEquals(testPhoneAccount.getAccountHandle(), intentExtras.get(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE)); } else { assertTrue(didExceptionOccur); verify(mFakePhoneAccountRegistrar, never()) .registerPhoneAccount(any(PhoneAccount.class)); verify(mContext, never()) .sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), anyString()); } } Loading @@ -497,14 +485,6 @@ public class TelecomServiceImplTest extends TelecomTestCase { mTSIBinder.unregisterPhoneAccount(phHandle); verify(mFakePhoneAccountRegistrar).unregisterPhoneAccount(phHandle); verify(mContext).sendBroadcastAsUser(intentCaptor.capture(), eq(UserHandle.ALL), anyString()); Intent capturedIntent = intentCaptor.getValue(); assertEquals(TelecomManager.ACTION_PHONE_ACCOUNT_UNREGISTERED, capturedIntent.getAction()); Bundle intentExtras = capturedIntent.getExtras(); assertEquals(1, intentExtras.size()); assertEquals(phHandle, intentExtras.get(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE)); } @SmallTest Loading
tests/src/com/android/server/telecom/tests/TelecomSystemTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isNull; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; Loading Loading @@ -311,6 +312,7 @@ public class TelecomSystemTest extends TelecomTestCase { super.setUp(); mSpyContext = mComponentContextFixture.getTestDouble().getApplicationContext(); doReturn(mSpyContext).when(mSpyContext).getApplicationContext(); doNothing().when(mSpyContext).sendBroadcastAsUser(any(), any(), any()); mNumOutgoingCallsMade = 0; Loading