/frameworks/base/services/robotests/src/com/android/server/location/ |
NtpTimeHelperTest.java | 62 doReturn(NtpTimeHelper.NTP_INTERVAL - 1).when(mMockNtpTrustedTime).getCacheAge(); 63 doReturn(MOCK_NTP_TIME).when(mMockNtpTrustedTime).getCachedNtpTime(); 74 doReturn(NtpTimeHelper.NTP_INTERVAL + 1).when(mMockNtpTrustedTime).getCacheAge(); 75 doReturn(false).when(mMockNtpTrustedTime).forceRefresh(); 81 doReturn(true).when(mMockNtpTrustedTime).forceRefresh(); 82 doReturn(1L).when(mMockNtpTrustedTime).getCacheAge(); 83 doReturn(MOCK_NTP_TIME).when(mMockNtpTrustedTime).getCachedNtpTime();
|
/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ |
ZenModeExtractorTest.java | 28 import static org.mockito.Mockito.when; 61 when(mZenModeHelper.shouldIntercept(any())).thenReturn(true); 62 when(mZenModeHelper.getNotificationPolicy()).thenReturn( 76 when(mZenModeHelper.shouldIntercept(any())).thenReturn(false); 77 when(mZenModeHelper.getNotificationPolicy()).thenReturn( 91 when(mZenModeHelper.shouldIntercept(any())).thenReturn(true); 92 when(mZenModeHelper.getNotificationPolicy()).thenReturn(
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/ |
AppStorageSettingsTest.java | 26 import static org.mockito.Mockito.when; 64 when(mButtonsPref.setButton1OnClickListener(any(View.OnClickListener.class))) 70 when(mButtonsPref.setButton2OnClickListener(any(View.OnClickListener.class))) 90 when(stats.getCacheBytes()).thenReturn(5000L); 91 when(stats.getDataBytes()).thenReturn(10000L); 92 doNothing().when(mSettings).handleClearCacheClick(); 93 doNothing().when(mSettings).handleClearDataClick();
|
RecentAppsPreferenceControllerTest.java | 32 import static org.mockito.Mockito.when; 100 doReturn(mUsageStatsManager).when(mContext).getSystemService(Context.USAGE_STATS_SERVICE); 101 doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE); 102 doReturn(mPackageManager).when(mContext).getPackageManager(); 105 when(mScreen.findPreference(anyString())).thenReturn(mCategory); 107 when(mScreen.findPreference(RecentAppsPreferenceController.KEY_SEE_ALL)) 109 when(mScreen.findPreference(RecentAppsPreferenceController.KEY_DIVIDER)) 111 when(mCategory.getContext()).thenReturn(mContext); 133 doNothing().when(mController).refreshUi(mContext); 172 when(mAppState.getEntry(stat1.mPackageName, UserHandle.myUserId()) [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/defaultapps/ |
DefaultBrowserPreferenceControllerTest.java | 24 import static org.mockito.Mockito.when; 61 when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager); 69 when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt())) 76 when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt())) 83 when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt())) 100 when(mPackageManager.getDefaultBrowserPackageNameAsUser(anyInt())).thenReturn(null); 101 when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/display/ |
WallpaperPreferenceControllerTest.java | 23 import static org.mockito.Mockito.when; 58 when(mContext.getString(R.string.config_wallpaper_picker_package)) 60 when(mContext.getString(R.string.config_wallpaper_picker_class)) 62 when(mContext.getPackageManager()).thenReturn(mPackageManager); 71 when(mPackageManager.queryIntentActivities(any(Intent.class), anyInt())) 79 when(mPackageManager.queryIntentActivities(any(Intent.class), anyInt())).thenReturn(null); 84 when(mPackageManager.queryIntentActivities(any(Intent.class), anyInt()))
|
ThemePreferenceControllerTest.java | 26 import static org.mockito.Mockito.when; 65 when(mPackageManager.getApplicationInfo(any(), anyInt())).thenReturn(mApplicationInfo); 66 when(mContext.getPackageManager()).thenReturn(mPackageManager); 67 when(mContext.getString(R.string.default_theme)) 81 doReturn("pkg1.theme1").when(mController).getCurrentTheme(); 82 doReturn(themes).when(mController).getAvailableThemes(); 83 when(mPackageManager.getApplicationInfo(anyString(), anyInt()).loadLabel(mPackageManager)) 100 doReturn(null).when(mController).getCurrentTheme(); 101 doReturn(themes).when(mController).getAvailableThemes(); 102 when(mPackageManager.getApplicationInfo(anyString(), anyInt()).loadLabel(mPackageManager) [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/enterprise/ |
EnterprisePrivacyPreferenceControllerTest.java | 20 import static org.mockito.Mockito.when; 61 when(mContext.getString(R.string.enterprise_privacy_settings_summary_generic)) 63 when(mFeatureFactory.enterprisePrivacyFeatureProvider.getDeviceOwnerOrganizationName()) 68 when(mContext.getResources().getString( 71 when(mFeatureFactory.enterprisePrivacyFeatureProvider.getDeviceOwnerOrganizationName()) 79 when(mFeatureFactory.enterprisePrivacyFeatureProvider.hasDeviceOwner()).thenReturn(false); 82 when(mFeatureFactory.enterprisePrivacyFeatureProvider.hasDeviceOwner()).thenReturn(true);
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/ |
ZenModeScheduleRuleSettingsTest.java | 23 import static org.mockito.Mockito.when; 72 doReturn(mActivity).when(mFragment).getActivity(); 76 doReturn(res).when(mFragment).getResources(); 77 when(mActivity.getTheme()).thenReturn(res.newTheme()); 78 when(mActivity.getIntent()).thenReturn(mIntent); 79 when(mActivity.getResources()).thenReturn(res); 80 when(mFragment.getContext()).thenReturn(mContext);
|
EmergencyTonePreferenceControllerTest.java | 21 import static org.mockito.Mockito.when; 63 when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager); 64 when(mTelephonyManager.getCurrentPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_CDMA); 65 when(mSetting.getActivity()).thenReturn(mActivity); 66 when(mActivity.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager); 67 when(mActivity.getContentResolver()).thenReturn(mContentResolver); 68 when(mActivity.getResources()).thenReturn(appContext.getResources()); 71 when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference); 72 doReturn(mScreen).when(mSetting).getPreferenceScreen(); 82 when(mTelephonyManager.getCurrentPhoneType()).thenReturn(TelephonyManager.PHONE_TYPE_GSM) [all...] |
/packages/services/Car/tests/carservice_test/src/com/android/car/ |
FastPairProviderTest.java | 22 import static org.mockito.Mockito.when; 65 when(mMockContext.getSystemService(Context.BLUETOOTH_SERVICE)).thenReturn( 67 when(mMockBluetoothManager.getAdapter()).thenReturn(mMockBluetoothAdapter); 68 when(mMockContext.getResources()).thenReturn(mMockResources); 69 when(mMockResources.getInteger(R.integer.fastPairModelId)).thenReturn(0); 70 when(mMockBluetoothAdapter.getBluetoothLeAdvertiser()).thenReturn(mBluetoothLeAdvertiser); 74 * Verify that when a model id is set it gets serialized correctly. 80 when(mMockResources.getInteger(R.integer.fastPairModelId)).thenReturn(modelId); 94 * Verify that when the model id is 0 Fast Pair is disabled.
|
/external/mockito/src/test/java/org/mockitousage/matchers/ |
CustomMatchersTest.java | 20 import static org.mockito.Mockito.when; 57 when(mock.oneArg(booleanThat(new IsAnyBoolean()))).thenReturn("foo"); 67 when(mock.oneArg(charThat(new IsSorZ()))).thenReturn("foo"); 96 when(mock.oneArg(byteThat(new IsZeroOrOne<Byte>()))).thenReturn("byte"); 97 when(mock.oneArg(shortThat(new IsZeroOrOne<Short>()))).thenReturn("short"); 98 when(mock.oneArg(intThat(new IsZeroOrOne<Integer>()))).thenReturn("int"); 99 when(mock.oneArg(longThat(new IsZeroOrOne<Long>()))).thenReturn("long"); 100 when(mock.oneArg(floatThat(new IsZeroOrOne<Float>()))).thenReturn("float"); 101 when(mock.oneArg(doubleThat(new IsZeroOrOne<Double>()))).thenReturn("double"); 116 when(mock.oneArg(argThat(new ContainsFoo()))).thenReturn("foo") [all...] |
MoreMatchersTest.java | 19 import static org.mockito.Mockito.when; 27 when(mock.objectArgMethod(any(String.class))).thenReturn("string"); 62 //when(mock.listArgMethod(anyList())).thenReturn("list"); 63 when(mock.listArgMethod(anyListOf(String.class))).thenReturn("list"); 72 //when(mock.setArgMethod(anySet())).thenReturn("set"); 73 when(mock.setArgMethod(anySetOf(String.class))).thenReturn("set"); 82 //when(mock.setArgMethod(anySet())).thenReturn("set"); 83 when(mock.forMap(anyMapOf(String.class, String.class))).thenReturn("map"); 92 //when(mock.setArgMethod(anySet())).thenReturn("set"); 93 when(mock.collectionArgMethod(anyCollectionOf(String.class))).thenReturn("collection") [all...] |
/packages/apps/ManagedProvisioning/tests/instrumentation/src/com/android/managedprovisioning/finalization/ |
UserProvisioningStateHelperTest.java | 28 import static org.mockito.Mockito.when; 63 when(mContext.getSystemService(DEVICE_POLICY_SERVICE)).thenReturn(mDevicePolicyManager); 77 when(mSettingsFacade.isUserSetupCompleted(mContext)).thenReturn(true); 78 when(mUtils.getManagedProfile(mContext)).thenReturn(UserHandle.of(MANAGED_PROFILE_USER_ID)); 80 // WHEN calling markUserProvisioningStateInitiallyDone 93 when(mSettingsFacade.isUserSetupCompleted(mContext)).thenReturn(false); 94 when(mUtils.getManagedProfile(mContext)).thenReturn(UserHandle.of(MANAGED_PROFILE_USER_ID)); 96 // WHEN calling markUserProvisioningStateInitiallyDone 112 when(mSettingsFacade.isUserSetupCompleted(mContext)).thenReturn(false); 114 // WHEN calling markUserProvisioningStateInitiallyDon [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/ |
SavedBluetoothDeviceUpdaterTest.java | 23 import static org.mockito.Mockito.when; 68 doReturn(mContext).when(mDashboardFragment).getContext(); 69 when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice); 70 when(mLocalManager.getProfileManager()).thenReturn(mLocalBluetoothProfileManager); 76 doNothing().when(mBluetoothDeviceUpdater).addPreference(any()); 77 doNothing().when(mBluetoothDeviceUpdater).removePreference(any()); 82 doReturn(BluetoothDevice.BOND_BONDED).when(mBluetoothDevice).getBondState(); 83 doReturn(false).when(mBluetoothDevice).isConnected(); 92 doReturn(BluetoothDevice.BOND_NONE).when(mBluetoothDevice).getBondState(); 93 doReturn(true).when(mBluetoothDevice).isConnected() [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/development/ |
LocalTerminalPreferenceControllerTest.java | 24 import static org.mockito.Mockito.when; 60 when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager); 61 when(mUserManager.isAdminUser()).thenReturn(true); 63 doReturn(true).when(mController).isAvailable(); 64 doReturn(mPackageManagerWrapper).when(mController).getPackageManagerWrapper(); 65 when(mPreferenceScreen.findPreference(mController.getPreferenceKey())) 72 when(mUserManager.isAdminUser()).thenReturn(false); 96 when(mPackageManagerWrapper.getApplicationEnabledSetting(TERMINAL_APP_PACKAGE)).thenReturn( 105 when(mPackageManagerWrapper.getApplicationEnabledSetting(TERMINAL_APP_PACKAGE)).thenReturn( 124 when(mUserManager.isAdminUser()).thenReturn(false) [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/fuelgauge/anomaly/ |
AnomalyLoaderTest.java | 25 import static org.mockito.Mockito.when; 81 doReturn(true).when(mAnomalyDetectionPolicy).isAnomalyDetectorEnabled(anyInt()); 82 doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE); 83 when(mContext.getPackageManager().getPackageUid(anyString(), anyInt())).thenReturn(UID); 88 doReturn(mWakeLockAnomalies).when(mWakeLockAnomalyDetector).detectAnomalies(any(), any()); 94 .when(mWakeupAlarmAnomalyDetector).detectAnomalies(any(), any()); 100 .when(mBluetoothScanAnomalyDetector).detectAnomalies(any(), any()); 109 doReturn(mWakeLockAnomalyDetector).when(mAnomalyLoader.mAnomalyUtils).getAnomalyDetector( 111 doReturn(mWakeupAlarmAnomalyDetector).when(mAnomalyLoader.mAnomalyUtils).getAnomalyDetector( 113 doReturn(mBluetoothScanAnomalyDetector).when( [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/support/ |
NewDeviceIntroSuggestionActivityTest.java | 28 import static org.mockito.Mockito.when; 67 when(mFeatureFactory.suggestionsFeatureProvider.getSharedPrefs(any(Context.class))) 75 when(mMockContext.getResources() 79 when(mFeatureFactory.supportFeatureProvider.getNewDeviceIntroUrl(any(Context.class))) 93 when(mMockContext.getResources() 97 when(mFeatureFactory.supportFeatureProvider.getNewDeviceIntroUrl(any(Context.class))) 107 when(mMockContext.getResources() 125 when(mFeatureFactory.supportFeatureProvider.getNewDeviceIntroUrl(any(Context.class))) 132 when(mFeatureFactory.supportFeatureProvider.getNewDeviceIntroUrl(any(Context.class))) 142 when(mFeatureFactory.supportFeatureProvider.getNewDeviceIntroUrl(any(Context.class)) [all...] |
/packages/apps/Settings/tests/robotests/src/com/android/settings/wifi/ |
WifiInfoPreferenceControllerTest.java | 25 import static org.mockito.Mockito.when; 75 when(mContext.getSystemService(WifiManager.class)) 77 when(mScreen.findPreference(anyString())) 80 when(mWifiManager.getConnectionInfo()).thenReturn(mWifiInfo); 105 when(mWifiManager.getCurrentNetwork()).thenReturn(null); 106 when(mWifiInfo.getMacAddress()).thenReturn(TEST_MAC_ADDRESS); 117 when(mWifiManager.getCurrentNetwork()).thenReturn(null); 122 when(mWifiInfo.getMacAddress()).thenReturn(null); 126 when(mWifiInfo.getMacAddress()).thenReturn(WifiInfo.DEFAULT_MAC_ADDRESS); 130 when(mWifiInfo.getMacAddress()).thenReturn(TEST_MAC_ADDRESS) [all...] |
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/network/ |
BlockingHttpClientTests.java | 22 import static org.mockito.Mockito.when; 57 when(mMockHttpConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_BAD_GATEWAY); 71 when(mMockHttpConnection.getResponseCode()).thenReturn( 87 when(mMockHttpConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_FORBIDDEN); 88 when(mMockHttpConnection.getOutputStream()).thenReturn(mockOutputStream); 105 when(mMockHttpConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); 106 when(mMockHttpConnection.getInputStream()).thenReturn(new ByteArrayInputStream(response)); 120 when(mMockHttpConnection.getOutputStream()).thenReturn(mockOutputStream); 121 when(mMockHttpConnection.getResponseCode()).thenReturn(HttpURLConnection.HTTP_OK); 122 when(mMockHttpConnection.getInputStream()).thenReturn(new ByteArrayInputStream(response)) [all...] |
/packages/services/Telecomm/tests/src/com/android/server/telecom/tests/ |
CreateConnectionProcessorTest.java | 61 import static org.mockito.Mockito.when; 93 when(mMockCall.getConnectionServiceFocusManager()).thenReturn( 107 ).when(mConnectionServiceFocusManager).requestFocus(any(), any()); 125 when(mMockCall.isEmergencyCall()).thenReturn(false); 127 when(mMockAccountRegistrar.getSimCallManagerFromCall(any(Call.class))).thenReturn(null); 146 when(mMockCall.isEmergencyCall()).thenReturn(false); 147 when(mMockCall.getTargetPhoneAccount()).thenReturn(pAHandle); 150 when(mMockAccountRegistrar.getSimCallManagerFromCall(any(Call.class))).thenReturn(null); 165 when(mMockCall.isEmergencyCall()).thenReturn(false); 172 when(mMockAccountRegistrar.getPhoneAccountUnchecked(pAHandle)).thenReturn [all...] |
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/p2p/ |
SupplicantP2pIfaceHalTest.java | 27 import static org.mockito.Mockito.when; 187 when(mServiceManagerMock.linkToDeath(any(IHwBinder.DeathRecipient.class), 189 when(mServiceManagerMock.registerForNotifications(anyString(), anyString(), 191 when(mISupplicantMock.linkToDeath(any(IHwBinder.DeathRecipient.class), 193 when(mISupplicantP2pIfaceMock.linkToDeath(any(IHwBinder.DeathRecipient.class), 195 when(mISupplicantP2pIfaceMock.registerCallback(any(ISupplicantP2pIfaceCallback.class))) 210 * Tests the initialization flow, with a RemoteException occurring when 'getInterface' is called 247 * Tests the initialization flow, with a RemoteException occurring when 'getInterface' is called 289 when(mISupplicantMockV1_1.removeInterface(any(ISupplicant.IfaceInfo.class))) 315 .when(mISupplicantP2pIfaceMock).getName(any(ISupplicantIface.getNameCallback.class)) [all...] |
/cts/tests/autofillservice/src/android/autofillservice/cts/ |
RegexValidatorTest.java | 22 import static org.mockito.Mockito.when; 65 when(finder.findByAutofillId(unknownId)).thenReturn(null); 77 when(finder.findByAutofillId(creditCardFieldId)).thenReturn("1234 5678 9012 3456"); 80 when(finder.findByAutofillId(creditCardFieldId)).thenReturn("invalid"); 91 when(finder.findByAutofillId(id)).thenReturn("123a456");
|
/external/caliper/caliper/src/test/java/com/google/caliper/config/ |
CaliperConfigLoaderTest.java | 20 import static org.mockito.Mockito.when; 62 when(optionsMock.caliperConfigFile()).thenReturn(tempConfigFile); 63 when(optionsMock.configProperties()).thenReturn(ImmutableMap.<String, String>of()); 70 when(optionsMock.caliperConfigFile()).thenReturn(tempConfigFile); 71 when(optionsMock.configProperties()).thenReturn(ImmutableMap.of(
|
/external/mockito/src/test/java/org/mockitousage/junitrule/ |
MutableStrictJUnitRuleTest.java | 18 import static org.mockito.Mockito.when; 25 //when 35 //when 49 when(mock.simpleMethod()).thenReturn("1"); 56 when(mock.simpleMethod()).thenReturn("1"); 65 when(mock.simpleMethod()).thenReturn("1"); 72 when(mock.simpleMethod()).thenReturn("1");
|