Home
last modified time | relevance | path

Searched refs:when (Results 1 – 25 of 145) sorted by relevance

123456

/cts/common/device-side/bedstead/dpmwrapper/src/main/java/com/android/bedstead/dpmwrapper/
DDevicePolicyManagerWrapper.java61 doReturn(spyString).when(spy).toString(); in getWrapper()
64 doAnswer(answer).when(spy).isAdminActive(any()); in getWrapper()
65 doAnswer(answer).when(spy).isDeviceOwnerApp(any()); in getWrapper()
66 doAnswer(answer).when(spy).isManagedProfile(any()); in getWrapper()
67 doAnswer(answer).when(spy).isProfileOwnerApp(any()); in getWrapper()
68 doAnswer(answer).when(spy).isAffiliatedUser(); in getWrapper()
71 doAnswer(answer).when(spy).setTime(any(), anyLong()); in getWrapper()
72 doAnswer(answer).when(spy).setTimeZone(any(), any()); in getWrapper()
73 doAnswer(answer).when(spy).setGlobalSetting(any(), any(), any()); in getWrapper()
76 doAnswer(answer).when(spy).setUserControlDisabledPackages(any(), any()); in getWrapper()
[all …]
DWifiManagerWrapper.java59 doReturn(spyString).when(spy).toString(); in getWrapper()
62 doAnswer(answer).when(spy).addNetwork(any()); in getWrapper()
63 doAnswer(answer).when(spy).enableNetwork(anyInt(), anyBoolean()); in getWrapper()
64 doAnswer(answer).when(spy).removeNetwork(anyInt()); in getWrapper()
65 doAnswer(answer).when(spy).getConfiguredNetworks(); in getWrapper()
66 doAnswer(answer).when(spy).updateNetwork(any()); in getWrapper()
67 doAnswer(answer).when(spy).saveConfiguration(); in getWrapper()
68 doAnswer(answer).when(spy).isWifiEnabled(); in getWrapper()
69 doAnswer(answer).when(spy).setWifiEnabled(anyBoolean()); in getWrapper()
72 doAnswer(answer).when(spy).getCallerConfiguredNetworks(); in getWrapper()
/cts/tests/tests/nfc/src/android/nfc/tech/cts/
DNdefFormatableTest.java25 import static org.mockito.Mockito.when;
85 when(mNfcTagMock.formatNdef(anyInt(), any())).thenReturn(ErrorCodes.SUCCESS); in testFormat()
86 when(mNfcTagMock.isNdef(anyInt())).thenReturn(true); in testFormat()
87 when(mNfcTagMock.ndefWrite(anyInt(), any())).thenReturn(ErrorCodes.SUCCESS); in testFormat()
98 when(mNfcTagMock.formatNdef(anyInt(), any())).thenReturn(ErrorCodes.SUCCESS); in testFormatReadOnly()
99 when(mNfcTagMock.isNdef(anyInt())).thenReturn(true); in testFormatReadOnly()
100 when(mNfcTagMock.ndefWrite(anyInt(), any())).thenReturn(ErrorCodes.SUCCESS); in testFormatReadOnly()
101 when(mNfcTagMock.ndefMakeReadOnly(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testFormatReadOnly()
112 when(mNfcTagMock.formatNdef(anyInt(), any())).thenReturn(ErrorCodes.ERROR_IO); in testFormatReadOnly_formatNdefIOError()
120 when(mNfcTagMock.formatNdef(anyInt(), any())).thenReturn(ErrorCodes.ERROR_INVALID_PARAM); in testFormatReadOnly_formatNdefFormatError()
[all …]
DNdefTest.java25 import static org.mockito.Mockito.when;
153 when(mNfcTagMock.isNdef(anyInt())).thenReturn(true); in testGetNdefMessage()
154 when(mNfcTagMock.ndefRead(anyInt())).thenReturn(mNdefMessage); in testGetNdefMessage()
155 when(mNfcTagMock.isPresent(anyInt())).thenReturn(true); in testGetNdefMessage()
170 when(mNfcTagMock.isNdef(anyInt())).thenReturn(true); in testGetNdefMessage_notNdef()
171 when(mNfcTagMock.isPresent(anyInt())).thenReturn(true); in testGetNdefMessage_notNdef()
179 when(mNfcTagMock.isNdef(anyInt())).thenReturn(true); in testGetNdefMessage_notNdefNotPresent()
180 when(mNfcTagMock.isPresent(anyInt())).thenReturn(false); in testGetNdefMessage_notNdefNotPresent()
188 when(mNfcTagMock.isNdef(anyInt())).thenReturn(true); in testGetNdefMessage_noTagOnRead()
189 when(mNfcTagMock.ndefRead(anyInt())).thenReturn(null); in testGetNdefMessage_noTagOnRead()
[all …]
DNfcATest.java26 import static org.mockito.Mockito.when;
96 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testTransceive()
110 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testGetMaxTransceiveLength()
111 when(mNfcTagMock.getMaxTransceiveLength(TagTechnology.NFC_A)).thenReturn(16); in testGetMaxTransceiveLength()
120 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testSetTimeout()
121 when(mNfcTagMock.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.SUCCESS); in testSetTimeout()
133 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testSetTimeout_invalidTimeout()
134 when(mNfcTagMock.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.ERROR_INVALID_PARAM); in testSetTimeout_invalidTimeout()
142 when(mNfcTagMock.getTimeout(anyInt())).thenReturn(250); in testGetTimeout()
150 when(mNfcTagMock.getTimeout(anyInt())).thenThrow(new RemoteException()); in testGetTimeout_serviceDead()
[all …]
DNfcFTest.java26 import static org.mockito.Mockito.when;
95 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testTransceive()
109 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testGetMaxTransceiveLength()
110 when(mNfcTagMock.getMaxTransceiveLength(TagTechnology.NFC_F)).thenReturn(16); in testGetMaxTransceiveLength()
119 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testSetTimeout()
120 when(mNfcTagMock.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.SUCCESS); in testSetTimeout()
132 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testSetTimeout_invalidTimeout()
133 when(mNfcTagMock.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.ERROR_INVALID_PARAM); in testSetTimeout_invalidTimeout()
141 when(mNfcTagMock.getTimeout(anyInt())).thenReturn(250); in testGetTimeout()
149 when(mNfcTagMock.getTimeout(anyInt())).thenThrow(new RemoteException()); in testGetTimeout_serviceDead()
[all …]
DMifareUltralightTest.java26 import static org.mockito.Mockito.when;
102 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testReadPages()
122 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testWritePage()
145 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testTransceieve()
158 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testGetMaxTransceiveLength()
159 when(mNfcTagMock.getMaxTransceiveLength(TagTechnology.MIFARE_ULTRALIGHT)).thenReturn(16); in testGetMaxTransceiveLength()
167 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testSetTimeout()
168 when(mNfcTagMock.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.SUCCESS); in testSetTimeout()
181 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testSetTimeout_invalidTimeout()
182 when(mNfcTagMock.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.ERROR_INVALID_PARAM); in testSetTimeout_invalidTimeout()
[all …]
DNfcBTest.java26 import static org.mockito.Mockito.when;
97 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testTransceive()
111 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testGetMaxTransceieveLength()
112 when(mNfcTagMock.getMaxTransceiveLength(TagTechnology.NFC_B)).thenReturn(16); in testGetMaxTransceieveLength()
134 when(mNfcTagMock.isPresent(anyInt())).thenReturn(true); in testIsConnected_isConnected()
142 when(mNfcTagMock.isPresent(anyInt())).thenReturn(false); in testIsConnected_notConnected()
151 when(mNfcTagMock.isPresent(anyInt())).thenThrow(new RemoteException()); in testIsConnected_serviceDead()
159 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testReconnect()
175 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.ERROR_CONNECT); in testReconnect_failReconnect()
183 when(mNfcTagMock.reconnect(anyInt())).thenThrow(new RemoteException()); in testReconnect_remoteException()
[all …]
DNfcVTest.java26 import static org.mockito.Mockito.when;
96 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testTransceive()
110 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in testGetMaxTransceiveLength()
111 when(mNfcTagMock.getMaxTransceiveLength(TagTechnology.NFC_V)).thenReturn(16); in testGetMaxTransceiveLength()
133 when(mNfcTagMock.isPresent(anyInt())).thenReturn(true); in testIsConnected_isConnected()
141 when(mNfcTagMock.isPresent(anyInt())).thenReturn(false); in testIsConnected_notConnected()
150 when(mNfcTagMock.isPresent(anyInt())).thenThrow(new RemoteException()); in testIsConnected_serviceDead()
158 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testReconnect()
174 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.ERROR_CONNECT); in testReconnect_failReconnect()
182 when(mNfcTagMock.reconnect(anyInt())).thenThrow(new RemoteException()); in testReconnect_remoteException()
[all …]
DIsoDepTest.java25 import static org.mockito.Mockito.when;
81 when(mINfcTag.isPresent(anyInt())).thenReturn(true); in testIsConnected_isConnected()
88 when(mINfcTag.isPresent(anyInt())).thenReturn(false); in testIsConnected_isNotConnected()
95 when(mINfcTag.isPresent(anyInt())).thenThrow(new RemoteException()); in testIsConnected_serviceDead()
102 when(mINfcTag.reconnect(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testReconnect_success()
116 when(mINfcTag.reconnect(anyInt())).thenReturn(ErrorCodes.ERROR_IO); in testReconnect_error()
123 when(mINfcTag.reconnect(anyInt())).thenThrow(new RemoteException()); in testReconnect_serviceDead()
130 when(mINfcTag.reconnect(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testClose()
138 when(mINfcTag.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.SUCCESS); in testSetTimeout_success()
148 when(mINfcTag.setTimeout(anyInt(), anyInt())).thenReturn(ErrorCodes.ERROR_INVALID_PARAM); in testSetTimeout_invalid()
[all …]
DMifareClassicTest.java26 import static org.mockito.Mockito.when;
260 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testAuthenticateSectorWithKeyA()
276 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testAuthenticateSectorWithKeyB()
293 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testAuthenticateSectorWithKeyB_nullTransceive()
304 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn(null); in testAuthenticateSectorWithKeyB_ioException()
313 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testReadBlock()
328 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testWriteBlock()
352 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testIncrement()
366 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testDecrement()
380 when(mNfcTagMock.transceive(anyInt(), any(), anyBoolean())).thenReturn( in testTransfer()
[all …]
DNfcBarcodeTest.java24 import static org.mockito.Mockito.when;
117 when(mNfcTagMock.isPresent(anyInt())).thenReturn(true); in testIsConnected_isConnected()
125 when(mNfcTagMock.isPresent(anyInt())).thenReturn(false); in testIsConnected_notConnected()
134 when(mNfcTagMock.isPresent(anyInt())).thenThrow(new RemoteException()); in testIsConnected_serviceDead()
142 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testReconnect()
158 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.ERROR_CONNECT); in testReconnect_failReconnect()
166 when(mNfcTagMock.reconnect(anyInt())).thenThrow(new RemoteException()); in testReconnect_remoteException()
174 when(mNfcTagMock.reconnect(anyInt())).thenReturn(ErrorCodes.SUCCESS); in testClose()
175 when(mNfcTagMock.isPresent(anyInt())).thenReturn(true); in testClose()
184 when(mNfcTagMock.isTagUpToDate(anyLong())).thenReturn(true); in createConnectedNfcBarcode()
[all …]
/cts/libs/helpers/core/tests/src/com/android/cts/helpers/
DDeviceInteractionHelperRuleTest.java20 import static org.mockito.Mockito.when;
60 when(mPackageManager.getApplicationInfo( in testMissingProperty()
78 when(mPackageManager.getApplicationInfo( in testEmptyProperty()
96 when(mPackageManager.getApplicationInfo( in testExplicitDefaultProperty()
115 when(mPackageManager.getApplicationInfo( in testOnePackageExplicitDefault()
118 when(mPackageManager.getApplicationInfo("test.b", PackageManager.GET_META_DATA)) in testOnePackageExplicitDefault()
136 when(mPackageManager.getApplicationInfo( in testOnePackage()
139 when(mPackageManager.getApplicationInfo("test.b", PackageManager.GET_META_DATA)) in testOnePackage()
158 when(mPackageManager.getApplicationInfo( in testTwoPackages()
161 when(mPackageManager.getApplicationInfo("test.b", PackageManager.GET_META_DATA)) in testTwoPackages()
[all …]
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DSmsCbMessageTest.java253 doReturn(0).when(cursor).getColumnIndexOrThrow(eq( in testCreateFromCursor()
255 doReturn(TEST_GEO_SCOPE).when(cursor).getInt(0); in testCreateFromCursor()
257 doReturn(1).when(cursor).getColumnIndexOrThrow(eq( in testCreateFromCursor()
259 doReturn(TEST_SERIAL).when(cursor).getInt(1); in testCreateFromCursor()
261 doReturn(2).when(cursor).getColumnIndexOrThrow(eq( in testCreateFromCursor()
263 doReturn(TEST_SERVICE_CATEGORY).when(cursor).getInt(2); in testCreateFromCursor()
265 doReturn(3).when(cursor).getColumnIndexOrThrow(eq( in testCreateFromCursor()
267 doReturn(TEST_LANGUAGE).when(cursor).getString(3); in testCreateFromCursor()
269 doReturn(4).when(cursor).getColumnIndexOrThrow(eq( in testCreateFromCursor()
271 doReturn(TEST_BODY).when(cursor).getString(4); in testCreateFromCursor()
[all …]
/cts/tests/autofillservice/src/android/autofillservice/cts/unittests/
DLuhnChecksumValidatorTest.java22 import static org.mockito.Mockito.when;
61 when(finder.findByAutofillId(id)).thenReturn("0005"); in duplicateFields()
65 when(finder.findByAutofillId(id)).thenReturn("0006"); in duplicateFields()
77 when(finder.findByAutofillId(id)).thenReturn("7992739871-3"); in leadingZerosAreIgnored()
80 when(finder.findByAutofillId(id)).thenReturn("07992739871-3"); in leadingZerosAreIgnored()
93 when(finder.findByAutofillId(id)).thenReturn("7992739871-" + i); in onlyOneChecksumValid()
108 when(finder.findByAutofillId(id1)).thenReturn("7992739871"); in nullAutofillValuesCauseFailure()
109 when(finder.findByAutofillId(id2)).thenReturn(null); in nullAutofillValuesCauseFailure()
110 when(finder.findByAutofillId(id3)).thenReturn("3"); in nullAutofillValuesCauseFailure()
122 when(finder.findByAutofillId(id)).thenReturn("a7B9^9\n2 7{3\b9\08\uD83C\uDF2D7-1_3$"); in nonDigits()
[all …]
DValidatorsTest.java65 doReturn(false).when(mValidValidator).isValid(mValueFinder); in testAnd_firstFailed()
73 doReturn(true).when(mValidValidator).isValid(mValueFinder); in testAnd_firstPassedSecondFailed()
74 doReturn(false).when(mValidValidator2).isValid(mValueFinder); in testAnd_firstPassedSecondFailed()
81 doReturn(true).when(mValidValidator).isValid(mValueFinder); in testAnd_AllPassed()
82 doReturn(true).when(mValidValidator2).isValid(mValueFinder); in testAnd_AllPassed()
103 doReturn(false).when(mValidValidator).isValid(mValueFinder); in testOr_AllFailed()
104 doReturn(false).when(mValidValidator2).isValid(mValueFinder); in testOr_AllFailed()
111 doReturn(true).when(mValidValidator).isValid(mValueFinder); in testOr_firstPassed()
119 doReturn(false).when(mValidValidator).isValid(mValueFinder); in testOr_secondPassed()
120 doReturn(true).when(mValidValidator2).isValid(mValueFinder); in testOr_secondPassed()
[all …]
DCharSequenceTransformationTest.java25 import static org.mockito.Mockito.when;
93 when(finder.findByAutofillId(id1)).thenReturn("a"); in testBadSubst()
94 when(finder.findByAutofillId(id2)).thenReturn("b"); in testBadSubst()
95 when(finder.findByAutofillId(id3)).thenReturn("c"); in testBadSubst()
96 when(finder.findByAutofillId(id4)).thenReturn("d"); in testBadSubst()
123 when(finder.findByAutofillId(id1)).thenReturn("1"); in testUnknownField()
124 when(finder.findByAutofillId(id2)).thenReturn("2"); in testUnknownField()
125 when(finder.findByAutofillId(unknownId)).thenReturn(null); in testUnknownField()
143 when(finder.findByAutofillId(creditCardFieldId)).thenReturn("1234 5678 9012 3456"); in testCreditCardObfuscator()
160 when(finder.findByAutofillId(id)).thenReturn("four"); in testReplaceAllByOne()
[all …]
DRegexValidatorTest.java22 import static org.mockito.Mockito.when;
66 when(finder.findByAutofillId(unknownId)).thenReturn(null); in unknownField()
78 when(finder.findByAutofillId(creditCardFieldId)).thenReturn("1234 5678 9012 3456"); in singleFieldValid()
81 when(finder.findByAutofillId(creditCardFieldId)).thenReturn("invalid"); in singleFieldValid()
92 when(finder.findByAutofillId(id)).thenReturn("123a456"); in singleFieldInvalid()
/cts/tests/tests/graphics/src/android/graphics/drawable/cts/
DDrawableContainerStateTest.java111 doReturn(false).when(dr0).isStateful(); in testIsStateful()
117 doReturn(false).when(dr1).isStateful(); in testIsStateful()
123 doReturn(true).when(dr2).isStateful(); in testIsStateful()
129 doReturn(false).when(dr3).isStateful(); in testIsStateful()
204 doReturn(1).when(dr0).getMinimumHeight(); in testConstantHeightsAndWidths()
205 doReturn(2).when(dr0).getMinimumWidth(); in testConstantHeightsAndWidths()
206 doReturn(0).when(dr0).getIntrinsicHeight(); in testConstantHeightsAndWidths()
207 doReturn(0).when(dr0).getIntrinsicWidth(); in testConstantHeightsAndWidths()
216 doReturn(0).when(dr1).getMinimumHeight(); in testConstantHeightsAndWidths()
217 doReturn(0).when(dr1).getMinimumWidth(); in testConstantHeightsAndWidths()
[all …]
/cts/tests/tests/content/src/android/content/cts/
DContentResolverWrapTest.java106 doReturn(RESULTS).when(mProvider).applyBatch(AUTHORITY, OPERATIONS); in testApplyBatch()
112 doReturn(42).when(mProvider).bulkInsert(URI, VALUES_ARRAY); in testBulkInsert()
118 doReturn(EXTRAS).when(mProvider).call(AUTHORITY, METHOD, ARG, EXTRAS); in testCall()
125 doReturn(URI).when(mProvider).canonicalize(URI); in testCanonicalize()
131 doReturn(URI).when(mProvider).uncanonicalize(URI); in testUncanonicalize()
137 doReturn(TYPE).when(mProvider).getType(URI); in testType()
143 doReturn(TYPE_ARRAY).when(mProvider).getStreamTypes(URI, TYPE); in testStreamTypes()
149 doReturn(URI).when(mProvider).insert(URI, VALUES); in testInsert()
155 doReturn(URI).when(mProvider).insert(URI, VALUES, EXTRAS); in testInsert_Extras()
161 doReturn(42).when(mProvider).update(URI, VALUES, ARG, ARG_ARRAY); in testUpdate()
[all …]
/cts/tests/tests/provider/src/android/provider/cts/
DDocumentsContractTest.java142 doReturn(pm).when(mContext).getPackageManager(); in testRootUri()
143 doReturn(infoList).when(pm).queryIntentContentProviders(any(Intent.class), anyInt()); in testRootUri()
159 doReturn(pm).when(mContext).getPackageManager(); in testRootUri_returnFalse()
160 doReturn(infoList).when(pm).queryIntentContentProviders(any(Intent.class), anyInt()); in testRootUri_returnFalse()
181 doReturn(pm).when(mContext).getPackageManager(); in testRootsUri()
182 doReturn(infoList).when(pm).queryIntentContentProviders(any(Intent.class), anyInt()); in testRootsUri()
195 doReturn(pm).when(mContext).getPackageManager(); in testRootsUri_returnsFalse()
196 doReturn(infoList).when(pm).queryIntentContentProviders(any(Intent.class), anyInt()); in testRootsUri_returnsFalse()
270 doReturn(DOC_RESULT).when(mProvider).createDocument(DOC_RED, MIME_TYPE, DISPLAY_NAME); in testCreateDocument()
276 doReturn(DOC_RESULT).when(mProvider).renameDocument(DOC_RED, DISPLAY_NAME); in testRenameDocument()
[all …]
/cts/common/device-side/util-axt/tests/src/com/android/compatibility/common/util/
DStateChangerRuleTest.java27 import static org.mockito.Mockito.when;
60 when(mStateManager.get()).thenReturn("before", "changed"); in testSetAndRestoreOnSuccess()
75 when(mStateManager.get()).thenReturn("sameValue"); in testDontSetIfSameValueOnSuccess()
87 when(mStateManager.get()).thenReturn("before", "before"); in testSetButDontRestoreIfSameValueOnSuccess()
101 when(mStateManager.get()).thenReturn("sameValue", "changed"); in testDontSetButRestoreIfValueChangedOnSuccess()
115 when(mStateManager.get()).thenReturn("before", "changed"); in testSetAndRestoreOnFailure()
116 doThrow(mRuntimeException).when(mStatement).evaluate(); in testSetAndRestoreOnFailure()
132 when(mStateManager.get()).thenReturn("sameValue"); in testDontSetIfSameValueOnFailure()
133 doThrow(mRuntimeException).when(mStatement).evaluate(); in testDontSetIfSameValueOnFailure()
146 when(mStateManager.get()).thenReturn("before", "before"); in testSetButDontRestoreIfSameValueOnFailure()
[all …]
DStateKeeperRuleTest.java27 import static org.mockito.Mockito.when;
58 when(mStateManager.get()).thenReturn("before", "changed"); in testRestoreOnSuccess()
71 when(mStateManager.get()).thenReturn("before", "changed"); in testRestoreOnFailure()
72 doThrow(mRuntimeException).when(mStatement).evaluate(); in testRestoreOnFailure()
86 when(mStateManager.get()).thenReturn("not_changed"); in testDoNotRestoreWhenNotChanged()
97 when(mStateManager.get()).thenReturn("not_changed"); in testDoNotRestoreOnFailure()
98 doThrow(mRuntimeException).when(mStatement).evaluate(); in testDoNotRestoreOnFailure()
/cts/tests/tests/view/src/android/view/cts/
DViewReceiveContentTest.java30 import static org.mockito.Mockito.when;
136 when(mReceiver.onReceiveContent(any(), any())).thenReturn(null); in testPerformReceiveContent()
159 when(mReceiver.onReceiveContent(any(), any())).thenReturn(null); in testOnReceiveContent()
168 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DRAG_STARTED); in testOnDragEvent_noOnReceiveContentListener()
171 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DROP); in testOnDragEvent_noOnReceiveContentListener()
180 when(mReceiver.onReceiveContent(any(), any())).thenReturn(null); in testOnDragEvent_withOnReceiveContentListener()
184 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DRAG_STARTED); in testOnDragEvent_withOnReceiveContentListener()
189 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DROP); in testOnDragEvent_withOnReceiveContentListener()
193 when(dragEvent.getClipData()).thenReturn(clip); in testOnDragEvent_withOnReceiveContentListener()
203 when(mReceiver.onReceiveContent(same(view), any(ContentInfo.class))).thenAnswer( in testOnDragEvent_withOnReceiveContentListener_noneOfTheContentAccepted()
[all …]
/cts/tests/tests/wifi/src/android/net/wifi/sharedconnectivity/cts/app/
DSharedConnectivityManagerTest.java33 import static org.mockito.Mockito.when;
143 when(mContext.getSystemServiceName(UserManager.class)).thenReturn(Context.USER_SERVICE); in setUp()
144 when(mContext.getSystemService(UserManager.class)).thenReturn(mUserManager); in setUp()
145 when(mUserManager.isUserUnlocked()).thenReturn(true); in setUp()
146 when(mContext.bindService(any(Intent.class), any(ServiceConnection.class), in setUp()
152 when(mResources.getString(anyInt())).thenThrow(new Resources.NotFoundException()); in resourcesNotDefined_createShouldReturnNull()
159 when(mResources.getString(anyInt())).thenReturn(""); in resourceStringsAreEmpty_createShouldReturnNull()
175 when(mContext.bindService(any(Intent.class), any(ServiceConnection.class), in bindToServiceFails_userUnlocked_callsOnRegisterCallbackFailed()
186 when(mUserManager.isUserUnlocked()).thenReturn(false); in bindToServiceFails_userLocked_registerReceiver()
187 when(mContext.bindService(any(Intent.class), any(ServiceConnection.class), in bindToServiceFails_userLocked_registerReceiver()
[all …]

123456