/cts/common/device-side/bedstead/dpmwrapper/src/main/java/com/android/bedstead/dpmwrapper/ |
D | DevicePolicyManagerWrapper.java | 61 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 …]
|
D | WifiManagerWrapper.java | 59 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()
|
D | HardwarePropertiesManagerWrapper.java | 59 doReturn(spyString).when(spy).toString(); in getWrapper() 62 doAnswer(answer).when(spy).getCpuUsages(); in getWrapper() 63 doAnswer(answer).when(spy).getDeviceTemperatures(anyInt(), anyInt()); in getWrapper() 64 doAnswer(answer).when(spy).getFanSpeeds(); in getWrapper()
|
D | GenericManagerWrapper.java | 19 import static org.mockito.Mockito.when; 54 when(mock.toString()).thenReturn(mockString); in getWrapper() 55 when(mock.getSecureIntSettings(any())).thenAnswer(answer); in getWrapper()
|
/cts/libs/helpers/core/tests/src/com/android/cts/helpers/ |
D | DeviceInteractionHelperRuleTest.java | 20 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/autofillservice/src/android/autofillservice/cts/unittests/ |
D | LuhnChecksumValidatorTest.java | 22 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 …]
|
D | ValidatorsTest.java | 65 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 …]
|
D | CharSequenceTransformationTest.java | 25 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 …]
|
D | RegexValidatorTest.java | 22 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()
|
D | ImageTransformationTest.java | 24 import static org.mockito.Mockito.when; 84 when(finder.findByAutofillId(unknownId)).thenReturn(null); in fieldCannotBeFound() 103 when(finder.findByAutofillId(id)).thenReturn("val"); in theOneOptionsMatches() 120 when(finder.findByAutofillId(id)).thenReturn("val"); in theOneOptionsMatchesWithContentDescription() 139 when(finder.findByAutofillId(id)).thenReturn("bad-val"); in noOptionsMatches() 158 when(finder.findByAutofillId(id)).thenReturn("val-2"); in multipleOptionsOneMatches() 176 when(finder.findByAutofillId(id)).thenReturn("val-2"); in multipleOptionsOneMatchesWithContentDescription() 196 when(finder.findByAutofillId(id)).thenReturn("ab"); in twoOptionsMatch() 215 when(finder.findByAutofillId(id)).thenReturn("ab"); in twoOptionsMatchWithContentDescription()
|
D | DateTransformationTest.java | 24 import static org.mockito.Mockito.when; 74 when(mValueFinder.findRawValueByAutofillId(mFieldId)) in testInvalidAutofillValueType() 91 when(mValueFinder.findRawValueByAutofillId(mFieldId)) in testValidAutofillValue()
|
/cts/tests/tests/graphics/src/android/graphics/drawable/cts/ |
D | DrawableContainerStateTest.java | 111 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/ |
D | ContentResolverWrapTest.java | 104 doReturn(RESULTS).when(mProvider).applyBatch(AUTHORITY, OPERATIONS); in testApplyBatch() 110 doReturn(42).when(mProvider).bulkInsert(URI, VALUES_ARRAY); in testBulkInsert() 116 doReturn(EXTRAS).when(mProvider).call(AUTHORITY, METHOD, ARG, EXTRAS); in testCall() 123 doReturn(URI).when(mProvider).canonicalize(URI); in testCanonicalize() 129 doReturn(URI).when(mProvider).uncanonicalize(URI); in testUncanonicalize() 135 doReturn(TYPE).when(mProvider).getType(URI); in testType() 141 doReturn(TYPE_ARRAY).when(mProvider).getStreamTypes(URI, TYPE); in testStreamTypes() 147 doReturn(URI).when(mProvider).insert(URI, VALUES); in testInsert() 153 doReturn(URI).when(mProvider).insert(URI, VALUES, EXTRAS); in testInsert_Extras() 159 doReturn(42).when(mProvider).update(URI, VALUES, ARG, ARG_ARRAY); in testUpdate() [all …]
|
D | ContentProviderClientTest.java | 95 doReturn(mICancellationSignal).when(mIContentProvider).createCancellationSignal(); in setUp() 127 doAnswer(ANSWER_SLEEP).when(mIContentProvider).query(mAttributionSource, URI, null, in testQueryTimeout() 149 doAnswer(ANSWER_SLEEP).when(mIContentProvider).getType(URI); in testGetTypeTimeout() 162 doAnswer(ANSWER_SLEEP).when(mIContentProvider).getStreamTypes(URI, ""); in testGetStreamTypesTimeout() 175 doAnswer(ANSWER_SLEEP).when(mIContentProvider).canonicalize(mAttributionSource, URI); in testCanonicalizeTimeout() 188 doAnswer(ANSWER_SLEEP).when(mIContentProvider).uncanonicalize(mAttributionSource, URI); in testUncanonicalizeTimeout() 202 doAnswer(ANSWER_SLEEP).when(mIContentProvider).refresh(mAttributionSource, URI, ARGS, in testRefreshTimeout() 223 doAnswer(ANSWER_SLEEP).when(mIContentProvider).insert(mAttributionSource, URI, in testInsertTimeout() 237 doAnswer(ANSWER_SLEEP).when(mIContentProvider).bulkInsert(mAttributionSource, URI, in testBulkInsertTimeout() 251 doAnswer(ANSWER_SLEEP).when(mIContentProvider).delete(mAttributionSource, URI, EXTRAS); in testDeleteTimeout() [all …]
|
D | DeferSyncTest.java | 37 import static org.mockito.Mockito.when; 89 when(alwaysSyncableAdapter.onUnsyncableAccount()).thenReturn(false); in noSyncsWhenDeferred() 90 when(notAlwaysSyncableAdapter.onUnsyncableAccount()).thenReturn(false); in noSyncsWhenDeferred() 113 when(adapter.onUnsyncableAccount()).thenReturn(false); in deferSyncAndMakeSyncable() 138 when(adapter.onUnsyncableAccount()).thenReturn(false); in deferSyncAndReportIsReady() 144 when(adapter.onUnsyncableAccount()).thenReturn(true); in deferSyncAndReportIsReady() 163 when(adapter.onUnsyncableAccount()).thenReturn(false); in deferSyncAndReportIsReadyAlwaysSyncable() 169 when(adapter.onUnsyncableAccount()).thenReturn(true); in deferSyncAndReportIsReadyAlwaysSyncable() 189 when(adapter.onUnsyncableAccount()).thenReturn(true, false); in onNewAccountForEachAccount()
|
D | ContentProviderOperationTest.java | 26 import static org.mockito.Mockito.when; 99 when(provider.insert(eq(TEST_URI), eq(TEST_VALUES), eqBundle(TEST_EXTRAS))) in testInsert() 117 when(provider.update(eq(TEST_URI), eq(TEST_VALUES), eqBundle(TEST_EXTRAS_WITH_SQL))) in testUpdate() 134 when(provider.delete(eq(TEST_URI), eqBundle(TEST_EXTRAS_WITH_SQL))) in testDelete() 155 when(provider.query(eq(TEST_URI), eq(new String[] { "test_key" }), in testAssertQuery() 170 when(provider.call(eq(TEST_URI.getAuthority()), eq(TEST_METHOD), in testCall() 249 when(provider.call(eq(TEST_URI.getAuthority()), eq(TEST_METHOD), in testExceptionAllowed()
|
/cts/tests/tests/provider/src/android/provider/cts/ |
D | DocumentsContractTest.java | 142 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/ |
D | StateChangerRuleTest.java | 27 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 …]
|
D | StateKeeperRuleTest.java | 27 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/ |
D | ViewReceiveContentTest.java | 30 import static org.mockito.Mockito.when; 125 when(mReceiver.onReceiveContent(any(), any())).thenReturn(null); in testPerformReceiveContent() 148 when(mReceiver.onReceiveContent(any(), any())).thenReturn(null); in testOnReceiveContent() 157 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DRAG_STARTED); in testOnDragEvent_noOnReceiveContentListener() 160 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DROP); in testOnDragEvent_noOnReceiveContentListener() 169 when(mReceiver.onReceiveContent(any(), any())).thenReturn(null); in testOnDragEvent_withOnReceiveContentListener() 173 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DRAG_STARTED); in testOnDragEvent_withOnReceiveContentListener() 178 when(dragEvent.getAction()).thenReturn(DragEvent.ACTION_DROP); in testOnDragEvent_withOnReceiveContentListener() 182 when(dragEvent.getClipData()).thenReturn(clip); in testOnDragEvent_withOnReceiveContentListener() 192 when(mReceiver.onReceiveContent(same(view), any(ContentInfo.class))).thenAnswer( in testOnDragEvent_withOnReceiveContentListener_noneOfTheContentAccepted() [all …]
|
D | GestureDetectorCtsActivity.java | 49 doReturn(true).when(mOnGestureListener).onDown(any(MotionEvent.class)); in onCreate() 50 doReturn(true).when(mOnGestureListener).onFling(any(MotionEvent.class), in onCreate() 52 doReturn(true).when(mOnGestureListener).onScroll(any(MotionEvent.class), in onCreate() 54 doReturn(true).when(mOnGestureListener).onSingleTapUp(any(MotionEvent.class)); in onCreate()
|
/cts/tests/tests/print/printTestUtilLib/src/android/print/test/ |
D | BasePrintTest.java | 33 import static org.mockito.Mockito.when; 695 doAnswer(layoutAnswer).when(adapter).onLayout(any(PrintAttributes.class), in createMockPrintDocumentAdapter() 700 doAnswer(writeAnswer).when(adapter).onWrite(any(PageRange[].class), in createMockPrintDocumentAdapter() 705 doAnswer(finishAnswer).when(adapter).onFinish(); in createMockPrintDocumentAdapter() 759 doCallRealMethod().when(callbacks).setSession(any(StubbablePrinterDiscoverySession.class)); in createMockPrinterDiscoverySessionCallbacks() 760 when(callbacks.getSession()).thenCallRealMethod(); in createMockPrinterDiscoverySessionCallbacks() 763 doAnswer(onStartPrinterDiscovery).when(callbacks).onStartPrinterDiscovery( in createMockPrinterDiscoverySessionCallbacks() 767 doAnswer(onStopPrinterDiscovery).when(callbacks).onStopPrinterDiscovery(); in createMockPrinterDiscoverySessionCallbacks() 770 doAnswer(onValidatePrinters).when(callbacks).onValidatePrinters( in createMockPrinterDiscoverySessionCallbacks() 774 doAnswer(onStartPrinterStateTracking).when(callbacks).onStartPrinterStateTracking( in createMockPrinterDiscoverySessionCallbacks() [all …]
|
/cts/tests/tests/content/lib/accountaccess/src/com.android.cts.content/ |
D | SyncAdapter.java | 20 import static org.mockito.Mockito.when; 35 when(delegate.onUnsyncableAccount()).thenCallRealMethod(); in setNewDelegate()
|
/cts/tests/tests/content/src/android/content/om/cts/ |
D | OverlayManagerTest.java | 24 import static org.mockito.Mockito.when; 64 when(mMockService.setEnabled(anyString(), any(Boolean.class), anyInt())) in testSetEnabled() 76 when(mMockService.setEnabledExclusiveInCategory(anyString(), anyInt())) in testSetEnabledExclusiveInCategory()
|
/cts/tests/tests/widget/src/android/widget/cts/ |
D | SearchView_CursorTest.java | 27 import static org.mockito.Mockito.when; 178 when(mockQueryTextListener.onQueryTextChange(anyString())).thenCallRealMethod(); in testSuggestionFiltering() 198 when(mockSuggestionListener.onSuggestionClick(anyInt())).thenCallRealMethod(); in testSuggestionSelection() 202 when(mockQueryTextListener.onQueryTextChange(anyString())).thenCallRealMethod(); in testSuggestionSelection() 244 when(mockSuggestionListener.onSuggestionClick(anyInt())).thenCallRealMethod(); in testSuggestionEnterKey() 248 when(mockQueryTextListener.onQueryTextChange(anyString())).thenCallRealMethod(); in testSuggestionEnterKey()
|