/external/robolectric-shadows/robolectric/src/test/java/org/robolectric/shadows/ |
D | ShadowCrossProfileAppsTest.java | 11 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 …]
|
D | ShadowWebViewTest.java | 4 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 …]
|
D | ShadowUserManagerTest.java | 12 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() 91 shadowOf(userManager).setUserRestriction(userHandle, UserManager.ENSURE_VERIFY_APPS, true); in hasUserRestriction() 102 shadowOf(userManager).setUserRestriction(userHandle, UserManager.ENSURE_VERIFY_APPS, true); in getUserRestrictions() 113 shadowOf(userManager).setUserRestriction(newUserHandle(10), UserManager.DISALLOW_CAMERA, true); in getUserRestrictions() 122 shadowOf(userManager) in clearUserRestrictions() 126 shadowOf(userManager).clearUserRestrictions(Process.myUserHandle()); in clearUserRestrictions() 134 shadowOf(userManager).setManagedProfile(true); in isManagedProfile() [all …]
|
D | ShadowDevicePolicyManagerTest.java | 22 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 …]
|
D | ShadowNotificationManagerTest.java | 9 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 …]
|
D | ShadowNotificationBuilderTest.java | 8 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 …]
|
D | ShadowMediaRouterTest.java | 9 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 …]
|
D | ShadowConnectivityManagerTest.java | 12 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 …]
|
D | ShadowVibratorTest.java | 5 import static org.robolectric.Shadows.shadowOf; 32 shadowOf(vibrator).setHasVibrator(false); in hasVibrator() 42 shadowOf(vibrator).setHasAmplitudeControl(true); in hasAmplitudeControl() 51 assertThat(shadowOf(vibrator).isVibrating()).isTrue(); in vibrateMilliseconds() 52 assertThat(shadowOf(vibrator).getMilliseconds()).isEqualTo(5000L); in vibrateMilliseconds() 55 assertThat(shadowOf(vibrator).isVibrating()).isFalse(); in vibrateMilliseconds() 63 assertThat(shadowOf(vibrator).isVibrating()).isTrue(); in vibratePattern() 64 assertThat(shadowOf(vibrator).getPattern()).isEqualTo(pattern); in vibratePattern() 65 assertThat(shadowOf(vibrator).getRepeat()).isEqualTo(1); in vibratePattern() 71 assertThat(shadowOf(vibrator).isVibrating()).isTrue(); in cancelled() [all …]
|
D | ShadowServiceTest.java | 5 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()).isSameAs(n); in startForeground() 78 assertThat(shadowOf(service).getLastForegroundNotificationId()).isEqualTo(23); in startForeground() 79 assertThat(shadowOf(nm2).getNotification(23)).isSameAs(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 …]
|
D | ShadowUsageStatsManagerTest.java | 9 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 …]
|
D | ShadowTelecomManagerTest.java | 7 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 …]
|
D | ShadowAccountManagerTest.java | 8 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 …]
|
D | ShadowIconTest.java | 5 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 …]
|
D | ShadowTextToSpeechTest.java | 8 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 …]
|
D | ShadowCanvasTest.java | 5 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 …]
|
D | ShadowLooperTest.java | 4 import static org.robolectric.Shadows.shadowOf; 89 assertThat(ShadowLooper.getShadowMainLooper()).isSameAs(shadowOf(Looper.getMainLooper())); in shadowMainLooper_shouldBeShadowOfMainLooper() 144 assertThat(shadowOf(looper).hasQuit()).named("hasQuit").isTrue(); in shouldNotQueueMessagesIfLooperIsQuit() 145 assertThat(shadowOf(looper).post(new Runnable() { in shouldNotQueueMessagesIfLooperIsQuit() 151 assertThat(shadowOf(looper).postAtFrontOfQueue(new Runnable() { in shouldNotQueueMessagesIfLooperIsQuit() 156 assertThat(shadowOf(looper).getScheduler().areAnyRunnable()).named("areAnyRunnable").isFalse(); in shouldNotQueueMessagesIfLooperIsQuit() 163 shadowOf(looper).pause(); in shouldThrowawayRunnableQueueIfLooperQuits() 164 shadowOf(looper).post(new Runnable() { in shouldThrowawayRunnableQueueIfLooperQuits() 170 assertThat(shadowOf(looper).hasQuit()).named("hasQuit").isTrue(); in shouldThrowawayRunnableQueueIfLooperQuits() 171 assertThat(shadowOf(looper).getScheduler().areAnyRunnable()).named("areAnyRunnable").isFalse(); in shouldThrowawayRunnableQueueIfLooperQuits() [all …]
|
D | ShadowAudioManagerTest.java | 5 import static org.robolectric.Shadows.shadowOf; 31 assertThat(shadowOf(audioManager).getLastAudioFocusRequest()).isNull(); in requestAudioFocus_shouldRecordArgumentsOfMostRecentCall() 33 assertThat(shadowOf(audioManager).getLastAudioFocusRequest().listener).isSameAs(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 …]
|
D | ShadowTypefaceTest.java | 5 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 …]
|
D | ShadowFingerprintManagerTest.java | 7 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 …]
|
D | ShadowAppTaskTest.java | 5 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()
|
D | ShadowScaleGestureDetectorTest.java | 6 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()
|
D | ShadowSoundPoolTest.java | 8 import static org.robolectric.Shadows.shadowOf; 48 assertThat(shadowOf(soundPool).wasResourcePlayed(R.raw.sound)).isTrue(); in playedSoundsFromResourcesAreRecorded() 59 assertThat(shadowOf(soundPool).getResourcePlaybacks(R.raw.sound)) in playedSoundsFromResourcesAreCollected() 73 assertThat(shadowOf(soundPool).wasPathPlayed("/mnt/sdcard/sound.wav")).isTrue(); in playedSoundsFromPathAreRecorded() 84 assertThat(shadowOf(soundPool).getPathPlaybacks("/mnt/sdcard/sound.wav")) in playedSoundsFromPathAreCollected() 98 shadowOf(soundPool).notifyPathLoaded("/mnt/sdcard/sound.wav", true); in notifyPathLoaded_notifiesListener() 110 shadowOf(soundPool).notifyResourceLoaded(R.raw.sound, true); in notifyResourceLoaded_notifiesListener() 122 shadowOf(soundPool).notifyPathLoaded("/mnt/sdcard/sound.wav", false); in notifyPathLoaded_notifiesFailure() 132 shadowOf(soundPool).notifyPathLoaded("/mnt/sdcard/sound.wav", false); in notifyResourceLoaded_doNotFailWithoutListener() 139 shadowOf(soundPool).notifyPathLoaded("no.mp3", true); in notifyPathLoaded_failIfLoadWasntCalled() [all …]
|
D | ShadowSmsManagerTest.java | 6 import static org.robolectric.Shadows.shadowOf; 36 ShadowSmsManager.TextSmsParams params = shadowOf(smsManager).getLastSentTextMessageParams(); in sendTextMessage_shouldStoreLastSentTextParameters() 58 …ShadowSmsManager.TextMultipartParams params = shadowOf(smsManager).getLastSentMultipartTextMessage… in sendMultipartMessage_shouldStoreLastSendMultimediaParameters() 88 …final ShadowSmsManager.DataMessageParams params = shadowOf(smsManager).getLastSentDataMessageParam… in sendDataMessage_shouldStoreLastParameters() 105 assertThat(shadowOf(smsManager).getLastSentDataMessageParams()).isNotNull(); in clearLastSentDataMessageParams_shouldClearParameters() 107 shadowOf(smsManager).clearLastSentDataMessageParams(); in clearLastSentDataMessageParams_shouldClearParameters() 108 assertThat(shadowOf(smsManager).getLastSentDataMessageParams()).isNull(); in clearLastSentDataMessageParams_shouldClearParameters() 114 assertThat(shadowOf(smsManager).getLastSentTextMessageParams()).isNotNull(); in clearLastSentTextMessageParams_shouldClearParameters() 116 shadowOf(smsManager).clearLastSentTextMessageParams(); in clearLastSentTextMessageParams_shouldClearParameters() 117 assertThat(shadowOf(smsManager).getLastSentTextMessageParams()).isNull(); in clearLastSentTextMessageParams_shouldClearParameters() [all …]
|
/external/exoplayer/tree/library/core/src/test/java/com/google/android/exoplayer2/ |
D | AudioFocusManagerTest.java | 77 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 …]
|