Home
last modified time | relevance | path

Searched refs:shadowOf (Results 1 – 25 of 203) sorted by relevance

123456789

/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/
DShadowCrossProfileAppsTest.java11 import static org.robolectric.Shadows.shadowOf;
51 shadowOf(crossProfileApps).addTargetUserProfile(userHandle1); in getTargetUserProfiles_oneProfileAdded_shouldReturnProfileAdded()
58 shadowOf(crossProfileApps).addTargetUserProfile(userHandle1); in getTargetUserProfiles_oneProfileAddedTwice_shouldReturnSingleProfileAdded()
59 shadowOf(crossProfileApps).addTargetUserProfile(userHandle1); in getTargetUserProfiles_oneProfileAddedTwice_shouldReturnSingleProfileAdded()
66 shadowOf(crossProfileApps).addTargetUserProfile(userHandle1); in getTargetUserProfiles_multipleProfilesAdded_shouldReturnAllProfilesAddedInOrder()
67 shadowOf(crossProfileApps).addTargetUserProfile(userHandle2); in getTargetUserProfiles_multipleProfilesAdded_shouldReturnAllProfilesAddedInOrder()
77 shadowOf(crossProfileApps).addTargetUserProfile(userHandle2); in getTargetUserProfiles_multipleProfilesAddedInAlternateOrder_shouldReturnAllProfilesAddedInOrder()
78 shadowOf(crossProfileApps).addTargetUserProfile(userHandle1); in getTargetUserProfiles_multipleProfilesAddedInAlternateOrder_shouldReturnAllProfilesAddedInOrder()
88 shadowOf(crossProfileApps).addTargetUserProfile(userHandle1); in getTargetUserProfiles_multipleProfilesAddedAndFirstRemoved_shouldReturnSecondProfile()
89 shadowOf(crossProfileApps).addTargetUserProfile(userHandle2); in getTargetUserProfiles_multipleProfilesAddedAndFirstRemoved_shouldReturnSecondProfile()
[all …]
DShadowWebViewTest.java4 import static org.robolectric.Shadows.shadowOf;
36 assertThat(shadowOf(webView).getLastLoadedUrl()).isEqualTo("http://example.com"); in shouldRecordLastLoadedUrl()
42 assertThat(shadowOf(webView).getLastLoadedUrl()).isEqualTo("http://example.com"); in shouldRecordLastLoadedUrlForRequestWithAdditionalHeaders()
43 assertThat(shadowOf(webView).getLastAdditionalHttpHeaders()).isNull(); in shouldRecordLastLoadedUrlForRequestWithAdditionalHeaders()
48 assertThat(shadowOf(webView).getLastLoadedUrl()).isEqualTo("http://example.com"); in shouldRecordLastLoadedUrlForRequestWithAdditionalHeaders()
49 assertThat(shadowOf(webView).getLastAdditionalHttpHeaders()).isNotNull(); in shouldRecordLastLoadedUrlForRequestWithAdditionalHeaders()
50 assertThat(shadowOf(webView).getLastAdditionalHttpHeaders()).containsKey("key1"); in shouldRecordLastLoadedUrlForRequestWithAdditionalHeaders()
51 assertThat(shadowOf(webView).getLastAdditionalHttpHeaders().get("key1")).isEqualTo("value1"); in shouldRecordLastLoadedUrlForRequestWithAdditionalHeaders()
57 ShadowWebView.LoadData lastLoadData = shadowOf(webView).getLastLoadData(); in shouldRecordLastLoadedData()
66 ShadowWebView.LoadDataWithBaseURL lastLoadData = shadowOf(webView).getLastLoadDataWithBaseURL(); in shouldRecordLastLoadDataWithBaseURL()
[all …]
DShadowVibratorTest.java5 import static org.robolectric.Shadows.shadowOf;
33 shadowOf(vibrator).setHasVibrator(false); in hasVibrator()
43 shadowOf(vibrator).setHasAmplitudeControl(true); in hasAmplitudeControl()
52 assertThat(shadowOf(vibrator).isVibrating()).isTrue(); in vibrateMilliseconds()
53 assertThat(shadowOf(vibrator).getMilliseconds()).isEqualTo(5000L); in vibrateMilliseconds()
57 assertThat(shadowOf(vibrator).isVibrating()).isFalse(); in vibrateMilliseconds()
65 assertThat(shadowOf(vibrator).isVibrating()).isTrue(); in vibratePattern()
66 assertThat(shadowOf(vibrator).getPattern()).isEqualTo(pattern); in vibratePattern()
67 assertThat(shadowOf(vibrator).getRepeat()).isEqualTo(1); in vibratePattern()
75 assertThat(shadowOf(vibrator).isVibrating()).isTrue(); in vibrateWaveformEffect()
[all …]
DShadowDevicePolicyManagerTest.java22 import static org.robolectric.Shadows.shadowOf;
84 shadowOf(devicePolicyManager).setProfileOwner(testComponent); in isDeviceOwnerShouldReturnFalseForProfileOwner()
96 shadowOf(devicePolicyManager).setDeviceOwner(testComponent); in isDeviceOwnerShouldReturnTrueForDeviceOwner()
108 shadowOf(devicePolicyManager).setDeviceOwner(testComponent); in getDeviceOwnerShouldReturnDeviceOwnerPackageName()
127 shadowOf(devicePolicyManager).setDeviceOwner(testComponent); in isDeviceManagedShouldReturnTrueWhenThereIsADeviceOwner()
158 shadowOf(devicePolicyManager).setDeviceOwner(testComponent); in isProfileOwnerShouldReturnFalseForDeviceOwner()
170 shadowOf(devicePolicyManager).setProfileOwner(testComponent); in isProfileOwnerShouldReturnTrueForProfileOwner()
181 shadowOf(devicePolicyManager).setProfileOwner(testComponent); in getProfileOwnerShouldReturnDeviceOwnerComponentName()
207 shadowOf(devicePolicyManager).setActiveAdmin(testComponent); in isAdminActiveShouldReturnTrueForAnyDeviceAdminDevice()
218 shadowOf(devicePolicyManager).setDeviceOwner(testComponent); in getActiveAdminsShouldReturnDeviceOwner()
[all …]
DShadowUserManagerTest.java12 import static org.robolectric.Shadows.shadowOf;
54 shadowOf(userManager).addUserProfile(anotherProfile); in shouldGetUserProfiles()
67 shadowOf(userManager).setApplicationRestrictions(packageName, restrictions); in testGetApplicationRestrictions()
81 shadowOf(userManager).setUserUnlocked(false); in isUserUnlocked()
97 shadowOf(userManager).setUserRestriction(userHandle, UserManager.ENSURE_VERIFY_APPS, true); in hasUserRestriction()
106 shadowOf(userManager).setUserRestriction(userHandle, UserManager.ENSURE_VERIFY_APPS, true); in getUserRestrictions()
117 shadowOf(userManager).setUserRestriction(newUserHandle(10), UserManager.DISALLOW_CAMERA, true); in getUserRestrictions()
135 shadowOf(userManager) in clearUserRestrictions()
139 shadowOf(userManager).clearUserRestrictions(Process.myUserHandle()); in clearUserRestrictions()
147 shadowOf(userManager).setManagedProfile(true); in isManagedProfile()
[all …]
DShadowNotificationManagerTest.java9 import static org.robolectric.Shadows.shadowOf;
70 assertThat(shadowOf(notificationManager).getNotificationChannels()).hasSize(1); in createNotificationChannel()
71 NotificationChannel channel = (NotificationChannel)shadowOf(notificationManager) in createNotificationChannel()
82 assertThat(shadowOf(notificationManager).getNotificationChannelGroups()).hasSize(1); in createNotificationChannelGroup()
83 NotificationChannelGroup group = (NotificationChannelGroup)shadowOf(notificationManager) in createNotificationChannelGroup()
96 assertThat(shadowOf(notificationManager).getNotificationChannels()).hasSize(2); in createNotificationChannels()
98 (NotificationChannel) shadowOf(notificationManager).getNotificationChannel("id"); in createNotificationChannels()
101 channel = (NotificationChannel) shadowOf(notificationManager).getNotificationChannel("id2"); in createNotificationChannels()
110 assertThat(shadowOf(notificationManager).isChannelDeleted(channelId)).isFalse(); in deleteNotificationChannel()
112 assertThat(shadowOf(notificationManager).isChannelDeleted(channelId)).isFalse(); in deleteNotificationChannel()
[all …]
DShadowNotificationBuilderTest.java8 import static org.robolectric.Shadows.shadowOf;
31 assertThat(shadowOf(notification).getContentTitle().toString()).isEqualTo("Hello"); in build_setsContentTitleOnNotification()
37 assertThat(shadowOf(notification).isOngoing()).isFalse(); in build_whenSetOngoingNotSet_leavesSetOngoingAsFalse()
43 assertThat(shadowOf(notification).isOngoing()).isTrue(); in build_whenSetOngoing_setsOngoingToTrue()
51 assertThat(shadowOf(notification).isWhenShown()).isTrue(); in build_whenShowWhenNotSet_setsShowWhenOnNotificationToTrue()
59 assertThat(shadowOf(notification).isWhenShown()).isFalse(); in build_setShowWhenOnNotification()
66 assertThat(shadowOf(notification).getContentText().toString()).isEqualTo("Hello Text"); in build_setsContentTextOnNotification()
80 assertThat(shadowOf(notification).getContentInfo().toString()).isEqualTo("11"); in build_setsContentInfoOnNotification()
102 assertThat(shadowOf(notification).isIndeterminate()).isTrue(); in build_setsProgressOnNotification_true()
109 assertThat(shadowOf(notification).getMax()).isEqualTo(50); in build_setsProgressOnNotification_false()
[all …]
DShadowMediaRouterTest.java9 import static org.robolectric.Shadows.shadowOf;
37 shadowOf(mediaRouter).addBluetoothRoute(); in testAddBluetoothRoute_additionalRouteAvailable()
43 shadowOf(mediaRouter).addBluetoothRoute(); in testAddBluetoothRoute_bluetoothRouteSelected()
50 shadowOf(mediaRouter).addBluetoothRoute(); in testAddBluetoothRoute_checkBluetoothRouteProperties()
58 shadowOf(mediaRouter).addBluetoothRoute(); in testAddBluetoothRoute_checkBluetoothRouteProperties_apiJbMr2()
66 shadowOf(mediaRouter).addBluetoothRoute(); in testAddBluetoothRoute_checkBluetoothRouteProperties_apiN()
75 shadowOf(mediaRouter).addBluetoothRoute(); in testSelectBluetoothRoute_getsSetAsSelectedRoute()
85 shadowOf(mediaRouter).addBluetoothRoute(); in testRemoveBluetoothRoute_whenBluetoothSelected_defaultRouteAvailableAndSelected()
87 shadowOf(mediaRouter).removeBluetoothRoute(); in testRemoveBluetoothRoute_whenBluetoothSelected_defaultRouteAvailableAndSelected()
95 shadowOf(mediaRouter).addBluetoothRoute(); in testRemoveBluetoothRoute_whenDefaultSelected_defaultRouteAvailableAndSelected()
[all …]
DShadowConnectivityManagerTest.java12 import static org.robolectric.Shadows.shadowOf;
42 shadowOfActiveNetworkInfo = shadowOf(connectivityManager.getActiveNetworkInfo()); in setUp()
93 shadowOf(connectivityManager).addNetwork(vpnNetwork, vpnNetworkInfo); in getNetworkInfo_shouldReturnAddedNetwork()
102 shadowOf(connectivityManager).removeNetwork(wifiNetwork); in getNetworkInfo_shouldNotReturnRemovedNetwork()
120 shadowOf(connectivityManager).setBackgroundDataSetting(true); in shouldGetAndSetBackgroundDataSetting()
126 shadowOf(connectivityManager).setActiveNetworkInfo(null); in setActiveNetworkInfo_shouldSetActiveNetworkInfo()
128 shadowOf(connectivityManager) in setActiveNetworkInfo_shouldSetActiveNetworkInfo()
154 shadowOf(connectivityManager).setDefaultNetworkActive(false); in getActiveNetwork_nullIfNetworkNotActive()
161 shadowOf(connectivityManager).setActiveNetworkInfo(null); in setActiveNetworkInfo_shouldSetActiveNetwork()
163 shadowOf(connectivityManager) in setActiveNetworkInfo_shouldSetActiveNetwork()
[all …]
DShadowServiceTest.java5 import static org.robolectric.Shadows.shadowOf;
50 assertThat(shadowOf(application).getUnboundServiceConnections()).isEmpty(); in shouldUnbindServiceAtShadowApplication()
52 assertThat(shadowOf(application).getUnboundServiceConnections()).hasSize(1); in shouldUnbindServiceAtShadowApplication()
63 shadowOf(RuntimeEnvironment.application).setUnbindServiceShouldThrowIllegalArgument(true); in shouldUnbindServiceWithExceptionWhenRequested()
77 assertThat(shadowOf(service).getLastForegroundNotification()).isSameInstanceAs(n); in startForeground()
78 assertThat(shadowOf(service).getLastForegroundNotificationId()).isEqualTo(23); in startForeground()
79 assertThat(shadowOf(nm2).getNotification(23)).isSameInstanceAs(n); in startForeground()
86 assertThat(shadowOf(service).isForegroundStopped()).isTrue(); in stopForeground()
87 assertThat(shadowOf(service).getNotificationShouldRemoved()).isTrue(); in stopForeground()
94 assertThat(shadowOf(nm2).getNotification(21)).isNull(); in stopForegroundRemovesNotificationIfAsked()
[all …]
DShadowUsageStatsManagerTest.java9 import static org.robolectric.Shadows.shadowOf;
64 shadowOf(usageStatsManager).addEvent(TEST_PACKAGE_NAME1, 500L, Event.MOVE_TO_FOREGROUND); in testQueryEvents_appendEventData_shouldCombineWithPreviousData()
65 shadowOf(usageStatsManager).addEvent(TEST_PACKAGE_NAME1, 1000L, Event.MOVE_TO_BACKGROUND); in testQueryEvents_appendEventData_shouldCombineWithPreviousData()
66 shadowOf(usageStatsManager) in testQueryEvents_appendEventData_shouldCombineWithPreviousData()
74 shadowOf(usageStatsManager).addEvent(TEST_PACKAGE_NAME2, 2000L, Event.MOVE_TO_BACKGROUND); in testQueryEvents_appendEventData_shouldCombineWithPreviousData()
75 shadowOf(usageStatsManager) in testQueryEvents_appendEventData_shouldCombineWithPreviousData()
107 shadowOf(usageStatsManager).addEvent(TEST_PACKAGE_NAME1, 500L, Event.MOVE_TO_FOREGROUND); in testQueryEvents_appendEventData_simulateTimeChange_shouldAddOffsetToPreviousData()
108 shadowOf(usageStatsManager).addEvent(TEST_PACKAGE_NAME1, 1000L, Event.MOVE_TO_BACKGROUND); in testQueryEvents_appendEventData_simulateTimeChange_shouldAddOffsetToPreviousData()
109 shadowOf(usageStatsManager) in testQueryEvents_appendEventData_simulateTimeChange_shouldAddOffsetToPreviousData()
117 shadowOf(usageStatsManager).addEvent(TEST_PACKAGE_NAME2, 2000L, Event.MOVE_TO_BACKGROUND); in testQueryEvents_appendEventData_simulateTimeChange_shouldAddOffsetToPreviousData()
[all …]
DShadowTelecomManagerTest.java7 import static org.robolectric.Shadows.shadowOf;
39 shadowOf(telecomService).setSimCallManager(handle); in getSimCallManager()
46 assertThat(shadowOf(telecomService).getAllPhoneAccountsCount()).isEqualTo(0); in registerAndUnRegister()
47 assertThat(shadowOf(telecomService).getAllPhoneAccounts()).hasSize(0); in registerAndUnRegister()
53 assertThat(shadowOf(telecomService).getAllPhoneAccountsCount()).isEqualTo(1); in registerAndUnRegister()
54 assertThat(shadowOf(telecomService).getAllPhoneAccounts()).hasSize(1); in registerAndUnRegister()
61 assertThat(shadowOf(telecomService).getAllPhoneAccountsCount()).isEqualTo(0); in registerAndUnRegister()
62 assertThat(shadowOf(telecomService).getAllPhoneAccounts()).hasSize(0); in registerAndUnRegister()
145 assertThat(shadowOf(telecomService).getAllIncomingCalls()).hasSize(1); in testAddNewIncomingCall()
152 assertThat(shadowOf(telecomService).getAllUnknownCalls()).hasSize(1); in testAddUnknownCall()
[all …]
DShadowAccountManagerTest.java8 import static org.robolectric.Shadows.shadowOf;
62 shadowOf(am).addAccount(a1); in testGetAccounts()
68 shadowOf(am).addAccount(a2); in testGetAccounts()
76 shadowOf(am).addAccount(new Account("name_1", "type_1")); in getAccountsByType_nullTypeReturnsAllAccounts()
77 shadowOf(am).addAccount(new Account("name_2", "type_2")); in getAccountsByType_nullTypeReturnsAllAccounts()
78 shadowOf(am).addAccount(new Account("name_3", "type_3")); in getAccountsByType_nullTypeReturnsAllAccounts()
89 shadowOf(am).addAccount(a1); in testGetAccountsByType()
96 shadowOf(am).addAccount(a2); in testGetAccountsByType()
103 shadowOf(am).addAccount(a3); in testGetAccountsByType()
114 shadowOf(am).addAccount(account); in addAuthToken()
[all …]
DShadowIconTest.java5 import static org.robolectric.Shadows.shadowOf;
29 assertThat(shadowOf(icon).getType()).isEqualTo(TYPE_RESOURCE); in testGetRes()
30 assertThat(shadowOf(icon).getResId()).isEqualTo(android.R.drawable.ic_delete); in testGetRes()
37 assertThat(shadowOf(icon).getType()).isEqualTo(TYPE_BITMAP); in testGetBitmap()
38 assertThat(shadowOf(icon).getBitmap()).isEqualTo(bitmap); in testGetBitmap()
45 assertThat(shadowOf(icon).getType()).isEqualTo(TYPE_DATA); in testGetData()
46 assertThat(shadowOf(icon).getDataBytes()).isEqualTo(data); in testGetData()
47 assertThat(shadowOf(icon).getDataOffset()).isEqualTo(100); in testGetData()
48 assertThat(shadowOf(icon).getDataLength()).isEqualTo(200); in testGetData()
55 assertThat(shadowOf(icon).getType()).isEqualTo(TYPE_URI); in testGetUri()
[all …]
DShadowTextToSpeechTest.java8 import static org.robolectric.Shadows.shadowOf;
44 assertThat(shadowOf(textToSpeech)).isNotNull(); in shouldNotBeNull()
49 assertThat(shadowOf(textToSpeech).getContext()).isEqualTo(activity); in getContext_shouldReturnContext()
54 assertThat(shadowOf(textToSpeech).getOnInitListener()).isEqualTo(listener); in getOnInitListener_shouldReturnListener()
60 assertThat(shadowOf(textToSpeech).getLastSpokenText()).isEqualTo("Hello"); in getLastSpokenText_shouldReturnSpokenText()
67 assertThat(shadowOf(textToSpeech).getLastSpokenText()).isEqualTo("Hi"); in getLastSpokenText_shouldReturnMostRecentText()
73 shadowOf(textToSpeech).clearLastSpokenText(); in clearLastSpokenText_shouldSetLastSpokenTextToNull()
74 assertThat(shadowOf(textToSpeech).getLastSpokenText()).isNull(); in clearLastSpokenText_shouldSetLastSpokenTextToNull()
79 assertThat(shadowOf(textToSpeech).isShutdown()).isFalse(); in isShutdown_shouldReturnFalseBeforeShutdown()
85 assertThat(shadowOf(textToSpeech).isShutdown()).isTrue(); in isShutdown_shouldReturnTrueAfterShutdown()
[all …]
DShadowCanvasTest.java5 import static org.robolectric.Shadows.shadowOf;
41 "Bitmap for file:/an/image.jpg at (100,200)", shadowOf(canvas).getDescription()); in shouldDescribeBitmapDrawing()
44 "Bitmap for file:/an/image.jpg at (100,200)", shadowOf(targetBitmap).getDescription()); in shouldDescribeBitmapDrawing()
52 …e.jpg at (5,6) with height=2 and width=2 taken from Rect(1, 2 - 3, 4)", shadowOf(canvas).getDescri… in shouldDescribeBitmapDrawing_withDestinationRect()
60 … (5.0,6.0) with height=2.5 and width=2.5 taken from Rect(1, 2 - 3, 4)", shadowOf(canvas).getDescri… in shouldDescribeBitmapDrawing_withDestinationRectF()
70 …"Bitmap for file:/an/image.jpg transformed by Matrix[pre=[], set={}, post=[]]", shadowOf(canvas).g… in shouldDescribeBitmapDrawing_WithMatrix()
73 …"Bitmap for file:/an/image.jpg transformed by Matrix[pre=[], set={}, post=[]]", shadowOf(targetBit… in shouldDescribeBitmapDrawing_WithMatrix()
94 shadowOf(canvas).getDescription()); in drawColor_shouldReturnDescription()
112 ShadowCanvas shadow = shadowOf(canvas); in drawPath_shouldRecordThePathAndThePaint()
114 ShadowPath drawnPath = shadowOf(shadow.getDrawnPath(0)); in drawPath_shouldRecordThePathAndThePaint()
[all …]
DShadowLooperTest.java5 import static org.robolectric.Shadows.shadowOf;
90 … assertThat(ShadowLooper.getShadowMainLooper()).isSameInstanceAs(shadowOf(Looper.getMainLooper())); in shadowMainLooper_shouldBeShadowOfMainLooper()
145 assertWithMessage("hasQuit").that(shadowOf(looper).hasQuit()).isTrue(); in shouldNotQueueMessagesIfLooperIsQuit()
146 assertWithMessage("postAtFrontOfQueue").that(shadowOf(looper).post(new Runnable() { in shouldNotQueueMessagesIfLooperIsQuit()
152 assertThat(shadowOf(looper).postAtFrontOfQueue(new Runnable() { in shouldNotQueueMessagesIfLooperIsQuit()
157 …assertWithMessage("areAnyRunnable").that(shadowOf(looper).getScheduler().areAnyRunnable()).isFalse… in shouldNotQueueMessagesIfLooperIsQuit()
164 shadowOf(looper).pause(); in shouldThrowawayRunnableQueueIfLooperQuits()
165 shadowOf(looper).post(new Runnable() { in shouldThrowawayRunnableQueueIfLooperQuits()
171 assertWithMessage("hasQuit").that(shadowOf(looper).hasQuit()).isTrue(); in shouldThrowawayRunnableQueueIfLooperQuits()
172 …assertWithMessage("areAnyRunnable").that(shadowOf(looper).getScheduler().areAnyRunnable()).isFalse… in shouldThrowawayRunnableQueueIfLooperQuits()
[all …]
DShadowAudioManagerTest.java5 import static org.robolectric.Shadows.shadowOf;
31 assertThat(shadowOf(audioManager).getLastAudioFocusRequest()).isNull(); in requestAudioFocus_shouldRecordArgumentsOfMostRecentCall()
33 … assertThat(shadowOf(audioManager).getLastAudioFocusRequest().listener).isSameInstanceAs(listener); in requestAudioFocus_shouldRecordArgumentsOfMostRecentCall()
34 assertThat(shadowOf(audioManager).getLastAudioFocusRequest().streamType).isEqualTo(999); in requestAudioFocus_shouldRecordArgumentsOfMostRecentCall()
35 assertThat(shadowOf(audioManager).getLastAudioFocusRequest().durationHint).isEqualTo(888); in requestAudioFocus_shouldRecordArgumentsOfMostRecentCall()
36 assertThat(shadowOf(audioManager).getLastAudioFocusRequest().audioFocusRequest).isNull(); in requestAudioFocus_shouldRecordArgumentsOfMostRecentCall()
44 shadowOf(audioManager).setNextFocusRequestResponse(AudioManager.AUDIOFOCUS_REQUEST_FAILED); in requestAudioFocus_shouldReturnTheSpecifiedValue()
53 assertThat(shadowOf(audioManager).getLastAudioFocusRequest()).isNull(); in requestAudioFocus2_shouldRecordArgumentsOfMostRecentCall()
62 assertThat(shadowOf(audioManager).getLastAudioFocusRequest().listener).isNull(); in requestAudioFocus2_shouldRecordArgumentsOfMostRecentCall()
63 assertThat(shadowOf(audioManager).getLastAudioFocusRequest().streamType).isEqualTo(-1); in requestAudioFocus2_shouldRecordArgumentsOfMostRecentCall()
[all …]
DShadowTypefaceTest.java5 import static org.robolectric.Shadows.shadowOf;
32 assertThat(shadowOf(typeface).getFontDescription().getFamilyName()).isEqualTo("roboto"); in create_withFamilyName_shouldCreateTypeface()
33 assertThat(shadowOf(typeface).getFontDescription().getStyle()).isEqualTo(Typeface.BOLD); in create_withFamilyName_shouldCreateTypeface()
41 assertThat(shadowOf(typeface).getFontDescription().getFamilyName()).isEqualTo("roboto"); in create_withFamily_shouldCreateTypeface()
42 assertThat(shadowOf(typeface).getFontDescription().getStyle()).isEqualTo(Typeface.ITALIC); in create_withFamily_shouldCreateTypeface()
49 assertThat(shadowOf(typeface).getFontDescription().getFamilyName()).isEqualTo(null); in create_withoutFamily_shouldCreateTypeface()
50 assertThat(shadowOf(typeface).getFontDescription().getStyle()).isEqualTo(Typeface.ITALIC); in create_withoutFamily_shouldCreateTypeface()
58 assertThat(shadowOf(typeface).getFontDescription().getFamilyName()).isEqualTo("myFont.ttf"); in createFromFile_withFile_shouldCreateTypeface()
66 assertThat(shadowOf(typeface).getFontDescription().getFamilyName()).isEqualTo("myFont.ttf"); in createFromFile_withPath_shouldCreateTypeface()
67 assertThat(shadowOf(typeface).getFontDescription().getStyle()).isEqualTo(Typeface.NORMAL); in createFromFile_withPath_shouldCreateTypeface()
[all …]
DShadowScaleGestureDetectorTest.java6 import static org.robolectric.Shadows.shadowOf;
31 assertSame(motionEvent, shadowOf(detector).getOnTouchEventMotionEvent()); in test_getOnTouchEventMotionEvent()
36 shadowOf(detector).setScaleFactor(2.0f); in test_getScaleFactor()
42 shadowOf(detector).setFocusXY(2.0f, 3.0f); in test_getFocusXY()
52 shadowOf(new ScaleGestureDetector(ApplicationProvider.getApplicationContext(), listener)) in test_getListener()
61 shadowOf(detector).setFocusXY(3f, 3f); in test_reset()
62 shadowOf(detector).setScaleFactor(4f); in test_reset()
63 assertSame(motionEvent, shadowOf(detector).getOnTouchEventMotionEvent()); in test_reset()
65 shadowOf(detector).reset(); in test_reset()
71 assertNull(shadowOf(detector).getOnTouchEventMotionEvent()); in assertDefaults()
DShadowAppTaskTest.java5 import static org.robolectric.Shadows.shadowOf;
27 assertThat(shadowOf(appTask).isFinishedAndRemoved()).isTrue(); in finishAndRemoveTask_marksTaskFinished()
32 assertThat(shadowOf(ShadowAppTask.newInstance()).isFinishedAndRemoved()).isFalse(); in taskIsNotFinishedInitially()
46 shadowOf(appTask).setTaskInfo(recentTaskInfo); in getTaskInfo_returnsCorrectValue()
57 assertThat(shadowOf(appTask).hasMovedToFront()).isTrue(); in moveToFront_movesTaskToFront()
62 assertThat(shadowOf(ShadowAppTask.newInstance()).hasMovedToFront()).isFalse(); in taskIsNotMovedToFrontInitially()
73 assertThat(shadowOf(activity).peekNextStartedActivity()).isNotNull(); in startActivity()
74 assertThat(shadowOf(activity).peekNextStartedActivity().getAction()) in startActivity()
84 assertThat(shadowOf(appTask).isExcludedFromRecents()).isTrue(); in setExcludeFromRecents_excludesFromRecents()
89 assertThat(shadowOf(ShadowAppTask.newInstance()).isExcludedFromRecents()).isFalse(); in taskIsNotExcludedFromRecentsInitially()
DShadowFingerprintManagerTest.java7 import static org.robolectric.Shadows.shadowOf;
46 shadowOf(manager).authenticationSucceeds(); in authenticate_success()
63 shadowOf(manager).authenticationFails(); in authenticate_failure()
72 shadowOf(manager).setHasEnrolledFingerprints(true); in hasEnrolledFingerprints()
79 assertThat(shadowOf(manager).getEnrolledFingerprints()).isEmpty(); in setDefaultFingerprints()
81 shadowOf(manager).setDefaultFingerprints(1); in setDefaultFingerprints()
85 assertThat(shadowOf(manager).getFingerprintId(0)).isEqualTo(0); in setDefaultFingerprints()
88 shadowOf(manager).setDefaultFingerprints(0); in setDefaultFingerprints()
95 assertThat(shadowOf(manager).getEnrolledFingerprints()).isEmpty(); in setHasEnrolledFingerprints_shouldSetNumberOfFingerprints()
97 shadowOf(manager).setHasEnrolledFingerprints(true); in setHasEnrolledFingerprints_shouldSetNumberOfFingerprints()
[all …]
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/
DAudioFocusManagerTest.java77 Shadows.shadowOf(audioManager).getLastAudioFocusRequest(); in setAudioAttributes_withNullUsage_doesNotManageAudioFocus()
84 Shadows.shadowOf(audioManager) in setAudioAttributes_withNullUsage_abandonsAudioFocus()
91 Shadows.shadowOf(audioManager).getLastAudioFocusRequest(); in setAudioAttributes_withNullUsage_abandonsAudioFocus()
100 Shadows.shadowOf(audioManager).getLastAbandonedAudioFocusListener(); in setAudioAttributes_withNullUsage_abandonsAudioFocus()
107 Shadows.shadowOf(audioManager) in setAudioAttributes_withNullUsage_abandonsAudioFocus_v26()
114 Shadows.shadowOf(audioManager).getLastAudioFocusRequest(); in setAudioAttributes_withNullUsage_abandonsAudioFocus_v26()
122 Shadows.shadowOf(audioManager).getLastAbandonedAudioFocusRequest(); in setAudioAttributes_withNullUsage_abandonsAudioFocus_v26()
140 Shadows.shadowOf(audioManager) in setAudioAttributes_withUsageMedia_usesAudioFocusGain()
150 Shadows.shadowOf(audioManager).getLastAudioFocusRequest(); in setAudioAttributes_withUsageMedia_usesAudioFocusGain()
156 Shadows.shadowOf(audioManager) in setAudioAttributes_inEndedState_requestsAudioFocus()
[all …]
/external/connectedappssdk/tests/robotests/src/test/java/com/google/android/enterprise/connectedapps/
DRobolectricTestUtilities.java25 import static org.robolectric.Shadows.shadowOf;
126 shadowOf(userManager).addUser(PERSONAL_PROFILE_USER_ID, "Personal Profile", /* flags= */ 0); in createPersonalUser()
127 shadowOf(userManager) in createPersonalUser()
129 shadowOf(userManager).setUserState(personalProfileUserHandle, UserState.STATE_RUNNING_UNLOCKED); in createPersonalUser()
133 shadowOf(userManager).addUser(WORK_PROFILE_USER_ID, "Work Profile", /* flags= */ 0); in createWorkUser()
134 shadowOf(userManager) in createWorkUser()
136 shadowOf(userManager).addProfile(WORK_PROFILE_USER_ID, WORK_PROFILE_USER_ID, "Work Profile", 0); in createWorkUser()
137 shadowOf(userManager) in createWorkUser()
142 shadowOf(userManager).setUserState(workProfileUserHandle, UserState.STATE_RUNNING_LOCKED); in turnOnWorkProfileWithoutUnlocking()
147 shadowOf(getMainLooper()).idle(); in turnOnWorkProfileWithoutUnlocking()
[all …]
/external/downloader/src/test/java/com/google/android/downloader/
DAndroidConnectivityHandlerTest.java21 import static org.robolectric.Shadows.shadowOf;
83 shadowOf(application).grantPermissions(permission.ACCESS_NETWORK_STATE); in checkConnectivity_noConnectivityRequired()
94 shadowOf(application).grantPermissions(permission.ACCESS_NETWORK_STATE); in checkConnectivity_noNetwork()
98 shadowOf(connectivityManager).setActiveNetworkInfo(null); in checkConnectivity_noNetwork()
108 shadowOf(application).grantPermissions(permission.ACCESS_NETWORK_STATE); in checkConnectivity_networkNotConnected()
112 shadowOf(connectivityManager) in checkConnectivity_networkNotConnected()
129 shadowOf(application).grantPermissions(permission.ACCESS_NETWORK_STATE); in checkConnectivity_wrongNetworkType()
133 shadowOf(connectivityManager) in checkConnectivity_wrongNetworkType()
150 shadowOf(application).grantPermissions(permission.ACCESS_NETWORK_STATE); in checkConnectivity_anyNetworkType()
154 shadowOf(connectivityManager) in checkConnectivity_anyNetworkType()
[all …]

123456789