Home
last modified time | relevance | path

Searched refs:mTargetContext (Results 1 – 25 of 98) sorted by relevance

1234

/packages/apps/DocumentsUI/tests/functional/com/android/documentsui/overlay/
DOverlayableTest.java49 mTargetContext.getResources().getBoolean(R.bool.is_launcher_enabled)).isNotNull(); in testConfig_isLauncherEnable_isNotNull()
55 mTargetContext.getResources().getString(R.string.default_root_uri)).isNotEmpty(); in testConfig_defaultRootUri_isNotEmpty()
61 mTargetContext.getResources().getString( in testConfig_preferredRootPackage_isNotNull()
68 mTargetContext.getResources().getString( in testConfig_trustedQuickViewerPackage_isNotNull()
75 mTargetContext.getResources().getDrawable( in testDrawable_icEject_isVectorDrawable()
82 mTargetContext.getResources().getDrawable( in testDrawable_icRootDownload_isVectorDrawable()
89 mTargetContext.getResources().getDrawable( in testDrawable_icSdStorage_isVectorDrawable()
96 mTargetContext.getResources().getDrawable( in testDrawable_icRootListSelector_isDrawable()
104 mTargetContext.getResources().getDimensionPixelSize( in testDimen_gridItemRadius_isReasonable()
107 mTargetContext.getResources().getDimensionPixelSize( in testDimen_gridItemRadius_isReasonable()
/packages/apps/EmergencyInfo/tests/unit/src/com/android/emergency/edit/
DEditInfoActivityTest.java59 private Context mTargetContext; field in EditInfoActivityTest
64 mTargetContext = mInstrumentation.getTargetContext(); in setUp()
66 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in setUp()
71 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in tearDown()
92 final PackageManager packageManager = mTargetContext.getPackageManager(); in testInitialState()
93 final String packageName = mTargetContext.getPackageName(); in testInitialState()
103 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().putString( in testClearAllPreferences()
105 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().putString( in testClearAllPreferences()
107 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().putString( in testClearAllPreferences()
109 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().putString( in testClearAllPreferences()
[all …]
/packages/apps/Contacts/tests/src/com/android/contacts/
DNoPermissionsLaunchSmokeTest.java47 private Context mTargetContext; field in NoPermissionsLaunchSmokeTest
51 mTargetContext = InstrumentationRegistry.getTargetContext(); in setUp()
52 assumeTrue(!hasPermission(mTargetContext, Manifest.permission.READ_CONTACTS)); in setUp()
53 assumeTrue(!hasPermission(mTargetContext, Manifest.permission.WRITE_CONTACTS)); in setUp()
54 assumeTrue(!hasPermission(mTargetContext, Manifest.permission.GET_ACCOUNTS)); in setUp()
55 assumeTrue(!hasPermission(mTargetContext, Manifest.permission.READ_PHONE_STATE)); in setUp()
56 assumeTrue(!hasPermission(mTargetContext, Manifest.permission.CALL_PHONE)); in setUp()
57 assumeTrue(!hasPermission(mTargetContext, Manifest.permission.READ_CALL_LOG)); in setUp()
61 DynamicShortcuts.reset(mTargetContext); in setUp()
76 final PackageManager packageManager = mTargetContext.getPackageManager(); in launchingMainActivityDoesntCrash()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/opp/
DBluetoothOppServiceCleanupTest.java44 private final Context mTargetContext = field in BluetoothOppServiceCleanupTest
50 AdapterService adapterService = new AdapterService(mTargetContext); in testStopAndCleanup()
58 mTargetContext.getContentResolver().insert(BluetoothShare.CONTENT_URI, values); in testStopAndCleanup()
70 mTargetContext.getContentResolver().delete(BluetoothShare.CONTENT_URI, null, null); in testStopAndCleanup()
75 mTargetContext in enableBtOppProvider()
78 mTargetContext.getPackageName(), in enableBtOppProvider()
83 new ComponentName(mTargetContext, BluetoothOppProvider.class.getCanonicalName()); in enableBtOppProvider()
84 mTargetContext in enableBtOppProvider()
DBluetoothOppTransferHistoryTest.java78 Context mTargetContext; field in BluetoothOppTransferHistoryTest
91 mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUp()
94 mIntent.setClass(mTargetContext, BluetoothOppTransferHistory.class); in setUp()
140 BluetoothOppTransferHistory.class, true, mTargetContext); in setUp()
149 BluetoothOppTransferHistory.class, false, mTargetContext); in tearDown()
155 mTargetContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); in onCreate_withDirectionInbound_displayInboundHistory()
167 onView(withText(mTargetContext.getText(R.string.inbound_history_title).toString())) in onCreate_withDirectionInbound_displayInboundHistory()
174 mTargetContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); in onCreate_withDirectionOutbound_displayOutboundHistory()
190 onView(withText(mTargetContext.getText(R.string.outbound_history_title).toString())) in onCreate_withDirectionOutbound_displayOutboundHistory()
227 onView(withText(mTargetContext.getText(R.string.transfer_clear_dlg_title).toString())) in onOptionsItemSelected_clearAllSelected_promptWarning()
[all …]
DBluetoothOppNotificationTest.java68 Context mTargetContext; field in BluetoothOppNotificationTest
82 mTargetContext = spy(new ContextWrapper(ApplicationProvider.getApplicationContext())); in setUp()
87 () -> mOppNotification = new BluetoothOppNotification(mTargetContext)); in setUp()
97 mTargetContext, com.android.bluetooth.opp.BluetoothOppReceiver.class); in setUp()
99 mTargetContext.getPackageManager().getComponentEnabledSetting(mReceiverName); in setUp()
100 mTargetContext in setUp()
118 mTargetContext in tearDown()
186 verify(mTargetContext) in updateActiveNotification()
196 mTargetContext.getString( in updateActiveNotification()
198 mTargetContext.getString(R.string.unknown_file)); in updateActiveNotification()
[all …]
DIncomingFileConfirmActivityTest.java83 Context mTargetContext; field in IncomingFileConfirmActivityTest
99 mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUp()
102 mIntent.setClass(mTargetContext, BluetoothOppIncomingFileConfirmActivity.class); in setUp()
151 BluetoothOppIncomingFileConfirmActivity.class, true, mTargetContext); in setUp()
161 BluetoothOppIncomingFileConfirmActivity.class, false, mTargetContext); in tearDown()
177 onView(withText(mTargetContext.getText(R.string.incoming_file_confirm_cancel).toString())) in onCreate_clickConfirmCancel_saveUSER_CONFIRMAMTION_DENIED()
180 onView(withText(mTargetContext.getText(R.string.incoming_file_confirm_cancel).toString())) in onCreate_clickConfirmCancel_saveUSER_CONFIRMAMTION_DENIED()
209 onView(withText(mTargetContext.getText(R.string.incoming_file_confirm_ok).toString())) in onCreate_clickConfirmOk_saveUSER_CONFIRMATION_CONFIRMED()
212 onView(withText(mTargetContext.getText(R.string.incoming_file_confirm_ok).toString())) in onCreate_clickConfirmOk_saveUSER_CONFIRMATION_CONFIRMED()
238 mTargetContext.sendBroadcast(in); in onTimeout_broadcastUserConfirmationTimeoutAction_sendDismissTimeoutDialogMessage()
DBluetoothOppBtEnableActivityTest.java51 Context mTargetContext; field in BluetoothOppBtEnableActivityTest
62 mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUp()
64 mIntent.setClass(mTargetContext, BluetoothOppBtEnableActivity.class); in setUp()
84 onView(withText(mTargetContext.getText(R.string.bt_enable_ok).toString())) in onCreate_clickOnEnable_launchEnablingActivity()
87 onView(withText(mTargetContext.getText(R.string.bt_enable_ok).toString())) in onCreate_clickOnEnable_launchEnablingActivity()
DBluetoothOppTestUtils.java145 public static void enableActivity(Class activityClass, boolean enable, Context mTargetContext) { in enableActivity() argument
149 mTargetContext in enableActivity()
152 mTargetContext.getPackageName(), enabledState, DONT_KILL_APP); in enableActivity()
154 ComponentName activityName = new ComponentName(mTargetContext, activityClass); in enableActivity()
155 mTargetContext in enableActivity()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/pbapclient/
DPbapParserTest.java48 private Context mTargetContext; field in PbapParserTest
53 mTargetContext = InstrumentationRegistry.getTargetContext(); in setUp()
57 mTargetContext.getString(com.android.bluetooth.R.string.pbap_account_type)); in setUp()
58 mTestResources = TestUtils.getTestApplicationResources(mTargetContext); in setUp()
76 mTargetContext, in testNoTimestamp()
103 mTargetContext, in testMissedCall()
129 mTargetContext, in testUnknownCall()
153 PhonebookPullRequest processor = new PhonebookPullRequest(mTargetContext); in testPullPhoneBook()
161 mTargetContext.getContentResolver().delete(Calls.CONTENT_URI, null, null); in cleanupCallLog()
165 mTargetContext in cleanupPhonebook()
[all …]
DCallLogPullRequestTest.java60 private Context mTargetContext; field in CallLogPullRequestTest
68 mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUp()
80 new CallLogPullRequest(mTargetContext, path, mCallCounter, mAccount); in testToString()
89 new CallLogPullRequest(mTargetContext, path, mCallCounter, mAccount); in onPullComplete_whenResultsAreNull()
102 new CallLogPullRequest(mTargetContext, invalidPath, mCallCounter, mAccount); in onPullComplete_whenPathIsInvalid()
116 new CallLogPullRequest(mTargetContext, path, mCallCounter, mAccount); in onPullComplete_whenResultsAreEmpty()
130 new CallLogPullRequest(mTargetContext, path, mCallCounter, mAccount); in onPullComplete_whenThereIsNoPhoneProperty()
154 new CallLogPullRequest(mTargetContext, path, mCallCounter, mAccount); in onPullComplete_success()
183 new CallLogPullRequest(mTargetContext, path, mCallCounter, mAccount); in updateTimesContacted_cursorIsClosed()
DAuthenticationServiceTest.java43 Context mTargetContext; field in AuthenticationServiceTest
49 mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUp()
61 intent.setClass(mTargetContext, AuthenticationService.class); in bind()
69 ComponentName serviceName = new ComponentName(mTargetContext, AuthenticationService.class); in enableService()
70 mTargetContext in enableService()
DPbapClientConnectionHandlerTest.java63 private Context mTargetContext; field in PbapClientConnectionHandlerTest
82 mTargetContext = in setUp()
93 mService = new PbapClientService(mTargetContext); in setUp()
103 when(mStateMachine.getContext()).thenReturn(mTargetContext); in setUp()
109 .setContext(mTargetContext) in setUp()
170 when(mTargetContext.getContentResolver()).thenReturn(res); in removeCallLog_doesNotCrash()
174 when(mTargetContext.getContentResolver()).thenReturn(null); in removeCallLog_doesNotCrash()
/packages/apps/EmergencyInfo/tests/unit/src/com/android/emergency/view/
DViewInfoActivityTest.java51 private Context mTargetContext; field in ViewInfoActivityTest
59 mTargetContext = mInstrumentation.getTargetContext(); in setUp()
82 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in tearDown()
102 PreferenceManager.getDefaultSharedPreferences(mTargetContext) in testNameSet()
124 PreferenceManager.getDefaultSharedPreferences(mTargetContext) in testMedicalInfoSet()
144 ContactTestUtils.createContact(mTargetContext.getContentResolver(), in testEmergencyContactsSet()
146 PreferenceManager.getDefaultSharedPreferences(mTargetContext) in testEmergencyContactsSet()
162 ContactTestUtils.deleteContact(mTargetContext.getContentResolver(), "John", "123")) in testEmergencyContactsSet()
169 ContactTestUtils.createContact(mTargetContext.getContentResolver(), in testMedicalInfoAndEmergencyContactsSet()
171 PreferenceManager.getDefaultSharedPreferences(mTargetContext) in testMedicalInfoAndEmergencyContactsSet()
[all …]
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/
DIconUtilsTest.java36 private Context mTargetContext; field in IconUtilsTest
40 mTargetContext = InstrumentationRegistry.getTargetContext(); in setUp()
45 assertThat(IconUtils.loadMimeIcon(mTargetContext, AUDIO_MIME_TYPE)).isNotNull(); in testLoadMimeIcon_isAudioMimeType()
50 assertThat(IconUtils.loadMimeIcon(mTargetContext, IMAGE_MIME_TYPE)).isNotNull(); in testLoadMimeIcon_isImageMimeType()
55 assertThat(IconUtils.loadMimeIcon(mTargetContext, GENERIC_MIME_TYPE)).isNotNull(); in testLoadMimeIcon_isGenericMimeType()
60 assertThat(IconUtils.loadMimeIcon(mTargetContext, VIDEO_MIME_TYPE)).isNotNull(); in testLoadMimeIcon_isVideoMimeType()
65 assertThat(IconUtils.loadMimeIcon(mTargetContext, TEXT_MIME_TYPE)).isNotNull(); in testLoadMimeIcon_isTextMimeType()
70 assertThat(IconUtils.loadMimeIcon(mTargetContext, null)).isNull(); in testLoadMimeIcon_isMimeTypeNull_shouldReturnNull()
/packages/apps/EmergencyInfo/tests/unit/src/com/android/emergency/preferences/
DEmergencyContactsPreferenceTest.java59 private Context mTargetContext; field in EmergencyContactsPreferenceTest
72 mTargetContext = mInstrumentation.getTargetContext(); in setUp()
75 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in setUp()
79 mTargetContext.getContentResolver(), NAME, PHONE_NUMBER); in setUp()
80 PreferenceManager.getDefaultSharedPreferences(mTargetContext) in setUp()
92 mTargetContext.getContentResolver(), NAME, PHONE_NUMBER)).isTrue(); in tearDown()
93 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in tearDown()
121 final Intent editActivityIntent = new Intent(mTargetContext, EditInfoActivity.class); in startActivityAndGetEmergencyContactsPreference()
DEmergencyListPreferenceTest.java44 private Context mTargetContext; field in EmergencyListPreferenceTest
49 mTargetContext = mInstrumentation.getTargetContext(); in setUp()
50 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in setUp()
55 PreferenceManager.getDefaultSharedPreferences(mTargetContext).edit().clear().commit(); in tearDown()
66 mTargetContext.getResources().getString(R.string.unknown_organ_donor); in testSummary_organDonor()
78 mTargetContext.getResources().getString(R.string.unknown_blood_type); in testSummary_bloodType()
89 String titleExp = mTargetContext.getResources().getString(R.string.organ_donor); in testTitle_organDonor()
100 CharSequence titleExp = mTargetContext.getResources().getString(R.string.blood_type); in testTitle_bloodType()
152 final Intent editActivityIntent = new Intent(mTargetContext, EditInfoActivity.class); in startEditInfoActivity()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/map/
DBluetoothMapSettingsTest.java56 Context mTargetContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); field in BluetoothMapSettingsTest
66 mIntent.setClass(mTargetContext, BluetoothMapSettings.class); in setUp()
85 String activityLabel = mTargetContext.getString(R.string.bluetooth_map_settings_title); in initialize()
98 mTargetContext in enableActivity()
101 mTargetContext.getPackageName(), enabledState, DONT_KILL_APP); in enableActivity()
103 ComponentName activityName = new ComponentName(mTargetContext, BluetoothMapSettings.class); in enableActivity()
104 mTargetContext in enableActivity()
/packages/apps/DocumentsUI/tests/functional/com/android/documentsui/ui/
DThemeUiTestBase.java44 protected Context mTargetContext; field in ThemeUiTestBase
52 mTargetContext = InstrumentationRegistry.getTargetContext(); in setUp()
53 mConfiguration = mTargetContext.getResources().getConfiguration(); in setUp()
54 mDisplayMetrics = mTargetContext.getResources().getDisplayMetrics(); in setUp()
55 mCompatibilityInfo = mTargetContext.getResources().getCompatibilityInfo(); in setUp()
60 mTargetContext.getResources().updateConfiguration(mConfiguration, mDisplayMetrics, in tearDown()
/packages/apps/Settings/tests/legacy_unit/src/com/android/settings/display/
DNightDisplaySettingsActivityTest.java41 private Context mTargetContext; field in NightDisplaySettingsActivityTest
46 mTargetContext = instrumentation.getTargetContext(); in setUp()
51 final boolean nightDisplayAvailable = mTargetContext.getResources().getBoolean( in nightDisplaySettingsIntent_resolvesCorrectly()
53 final PackageManager pm = mTargetContext.getPackageManager(); in nightDisplaySettingsIntent_resolvesCorrectly()
59 Assert.assertEquals(mTargetContext.getPackageName(), ri.activityInfo.packageName); in nightDisplaySettingsIntent_resolvesCorrectly()
/packages/apps/Settings/tests/legacy_unit/src/com/android/settings/notification/
DAppBubbleNotificationSettingsTest.java47 private Context mTargetContext; field in AppBubbleNotificationSettingsTest
53 mTargetContext = mInstrumentation.getTargetContext(); in setUp()
63 .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName()) in launchBubbleNotificationSetting_shouldNotCrash()
68 CharSequence name = mTargetContext.getApplicationInfo().loadLabel( in launchBubbleNotificationSetting_shouldNotCrash()
69 mTargetContext.getPackageManager()); in launchBubbleNotificationSetting_shouldNotCrash()
DChannelNotificationSettingsTest.java55 private Context mTargetContext; field in ChannelNotificationSettingsTest
63 mTargetContext = mInstrumentation.getTargetContext(); in setUp()
69 mNm = (NotificationManager) mTargetContext.getSystemService(Context.NOTIFICATION_SERVICE); in setUp()
78 .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName()) in launchNotificationSetting_shouldNotCrash()
97 mTargetContext.getPackageName(), Process.myUid(), blocked); in launchNotificationSettings_blockedChannel()
100 .putExtra(Settings.EXTRA_APP_PACKAGE, mTargetContext.getPackageName()) in launchNotificationSettings_blockedChannel()
/packages/apps/Launcher3/tests/src/com/android/launcher3/ui/widget/
DTaplBindWidgetTest.java96 mModel = LauncherAppState.getInstance(mTargetContext).getModel(); in setUp()
106 mTargetContext.getPackageManager().getPackageInstaller().abandonSession(mSessionId); in tearDown()
160 assertNotNull(AppWidgetManager.getInstance(mTargetContext) in testPendingWidget_withConfigScreen()
167 AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(mTargetContext); in testPendingWidget_withConfigScreen()
223 PackageInstaller installer = mTargetContext.getPackageManager().getPackageInstaller(); in testPendingWidget_notRestored_activeInstall()
256 new FavoriteItemsTransaction(mTargetContext).addItem(() -> item)); in addPendingItemToScreen()
262 commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext) in addWidgetToScreen()
264 LauncherAppWidgetInfo item = createWidgetInfo(info, mTargetContext, bindWidget); in addWidgetToScreen()
282 InstallSessionHelper.INSTANCE.get(mTargetContext).getActiveSessions() in getInvalidWidgetInfo()
288 mTargetContext.getPackageManager().getPackageInfo( in getInvalidWidgetInfo()
DTaplAddWidgetTest.java58 commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext)); in testDragIcon()
68 .getWidget(widgetInfo.getLabel(mTargetContext.getPackageManager())) in testDragIcon()
93 commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext)); in testDragCustomShortcut()
109 commitTransactionAndLoadHome(new FavoriteItemsTransaction(mTargetContext)); in testResizeWidget()
119 .getWidget(widgetInfo.getLabel(mTargetContext.getPackageManager())) in testResizeWidget()
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/btservice/
DDataMigrationTest.java75 private Context mTargetContext; field in DataMigrationTest
85 mTargetContext = InstrumentationRegistry.getTargetContext(); in setUp()
86 mTargetContext.deleteSharedPreferences(TEST_PREF); in setUp()
87 mPrefs = mTargetContext.getSharedPreferences(TEST_PREF, Context.MODE_PRIVATE); in setUp()
90 mMockContentResolver = new MockContentResolver(mTargetContext); in setUp()
92 when(mMockContext.getCacheDir()).thenReturn(mTargetContext.getCacheDir()); in setUp()
100 mTargetContext.deleteSharedPreferences(TEST_PREF); in tearDown()
101 mTargetContext.deleteDatabase("TestBluetoothDb"); in tearDown()
102 mTargetContext.deleteDatabase("TestOppDb"); in tearDown()
291 .thenReturn(mTargetContext.getDatabasePath("TestOppDb")); in testIncompleteDbMigration()
[all …]

1234