/cts/tests/tests/app/src/android/app/cts/ |
D | ServiceTest.java | 44 private Context mContext; field in ServiceTest 137 mContext.startService(new Intent(service).putExtras(bundle)); in startExpectResult() 140 mContext.startService(new Intent(service).putExtras(bundle)); in startExpectResult() 145 mContext.stopService(service); in startExpectResult() 149 mContext.stopService(service); in startExpectResult() 155 mContext.startService(service); in startExpectNoPermission() 185 mContext.bindService(service, conn, 0); in bindExpectResult() 186 mContext.startService(service); in bindExpectResult() 190 mContext.bindService(service, conn2, 0); in bindExpectResult() 193 mContext.unbindService(conn2); in bindExpectResult() [all …]
|
D | PendingIntentTest.java | 35 private Context mContext; field in PendingIntentTest 47 mContext = getContext(); in setUp() 102 mIntent.setClass(mContext, PendingIntentStubActivity.class); in testGetActivity() 104 mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent, in testGetActivity() 106 assertEquals(mContext.getPackageName(), mPendingIntent.getTargetPackage()); in testGetActivity() 116 mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent, in testGetActivity() 120 mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent, in testGetActivity() 142 mIntent.setClass(mContext, MockReceiver.class); in testGetBroadcast() 143 mPendingIntent = PendingIntent.getBroadcast(mContext, 1, mIntent, in testGetBroadcast() 153 mPendingIntent = PendingIntent.getBroadcast(mContext, 1, mIntent, in testGetBroadcast() [all …]
|
D | ProgressDialogTest.java | 48 private Context mContext; field in ProgressDialogTest 64 mContext = mActivity; in setUp() 65 mProgressDialog = new ProgressDialog(mContext); in setUp() 71 new ProgressDialog(mContext); in testProgressDialog1() 75 new ProgressDialog(mContext, com.android.cts.stub.R.style.Theme_AlertDialog); in testProgressDialog2() 79 MockProgressDialog pd = new MockProgressDialog(mContext); in testOnStartCreateStop() 94 mProgressDialog = ProgressDialog.show(mContext, TITLE, MESSAGE); in testShow1() 99 mProgressDialog = ProgressDialog.show(mContext, TITLE, MESSAGE, false); in testShow2() 107 mProgressDialog = ProgressDialog.show(mContext, TITLE, MESSAGE, true); in testShow2() 121 mProgressDialog = ProgressDialog.show(mContext, TITLE, MESSAGE, true, false); in testShow3() [all …]
|
D | AlertDialog_BuilderTest.java | 50 private Context mContext; field in AlertDialog_BuilderTest 110 mContext = getActivity(); in setUp() 125 new AlertDialog.Builder(mContext); in testConstructor() 131 mDrawable = mContext.getResources().getDrawable(android.R.drawable.btn_default); in testSetIconWithParamInt() 132 mBuilder = new AlertDialog.Builder(mContext); in testSetIconWithParamInt() 143 mDrawable = mContext.getResources().getDrawable(android.R.drawable.btn_default); in testSetIconWithParamDrawable() 144 mBuilder = new AlertDialog.Builder(mContext); in testSetIconWithParamDrawable() 155 mBuilder = new AlertDialog.Builder(mContext); in testSetPositiveButtonWithParamInt() 164 assertEquals(mContext.getText(android.R.string.yes), mButton.getText()); in testSetPositiveButtonWithParamInt() 171 mBuilder = new AlertDialog.Builder(mContext); in testSetPositiveButtonWithParamCharSequence() [all …]
|
/cts/tests/tests/content/src/android/content/cts/ |
D | ContextTest.java | 37 private Context mContext; field in ContextTest 42 mContext = getContext(); in setUp() 43 mContext.setTheme(R.style.Test_Theme); in setUp() 47 String testString = mContext.getString(R.string.context_test_string1); in testGetString() 50 testString = mContext.getString(R.string.context_test_string1, "expected"); in testGetString() 53 testString = mContext.getString(R.string.context_test_string2); in testGetString() 58 testString = mContext.getString(0, "expected"); in testGetString() 65 testString = mContext.getString(0); in testGetString() 72 CharSequence testCharSequence = mContext.getText(R.string.context_test_string2); in testGetText() 77 testCharSequence = mContext.getText(0); in testGetText() [all …]
|
D | Intent_ShortcutIconResourceTest.java | 31 Context mContext; field in Intent_ShortcutIconResourceTest 38 mContext = getContext(); in setUp() 42 String resourceName = mContext.getResources().getResourceName( in testToString() 44 mShortcutIconResource = ShortcutIconResource.fromContext(mContext, in testToString() 52 String resourceName = mContext.getResources().getResourceName( in testFromContext() 54 mShortcutIconResource = ShortcutIconResource.fromContext(mContext, in testFromContext() 59 assertEquals(mContext.getPackageName(), in testFromContext() 65 mShortcutIconResource = ShortcutIconResource.fromContext(mContext, in testWriteToParcel()
|
/cts/tests/tests/widget/src/android/widget/cts/ |
D | RadioButtonTest.java | 31 private Context mContext; field in RadioButtonTest 36 mContext = getInstrumentation().getTargetContext(); in setUp() 40 AttributeSet attrs = mContext.getResources().getLayout(R.layout.radiogroup_1); in testConstructor() 43 new RadioButton(mContext); in testConstructor() 50 new RadioButton(mContext, attrs); in testConstructor() 56 new RadioButton(mContext, null); in testConstructor() 58 new RadioButton(mContext, attrs, 0); in testConstructor() 64 new RadioButton(mContext, null, 0); in testConstructor() 65 new RadioButton(mContext, attrs, Integer.MAX_VALUE); in testConstructor() 66 new RadioButton(mContext, attrs, Integer.MIN_VALUE); in testConstructor() [all …]
|
D | ZoomControlsTest.java | 31 private Context mContext; field in ZoomControlsTest 36 mContext = getInstrumentation().getContext(); in setUp() 40 new ZoomControls(mContext); in testConstructor() 42 new ZoomControls(mContext, null); in testConstructor() 46 ZoomControls zoomControls = new ZoomControls(mContext); in testSetOnZoomInClickListener() 63 ZoomControls zoomControls = new ZoomControls(mContext); in testSetOnZoomOutClickListener() 74 ZoomControls zoomControls = new ZoomControls(mContext); in testSetZoomSpeed() 86 final ZoomControls zoomControls = new ZoomControls(mContext); in testShowAndHide() 97 ZoomControls zoomControls = new ZoomControls(mContext); in testSetIsZoomInEnabled() 103 ZoomControls zoomControls = new ZoomControls(mContext); in testSetIsZoomOutEnabled() [all …]
|
D | CursorAdapterTest.java | 77 final LayoutInflater inflater = LayoutInflater.from(mContext); in setUp() 94 new MockCursorAdapter(mContext, mCursor); in testConstructor() 98 new MockCursorAdapter(mContext, mCursor, true); in testConstructor() 113 cursorAdapter.init(mContext, null, false); in testInit() 114 assertSame(mContext, cursorAdapter.getContext()); in testInit() 121 cursorAdapter.init(mContext, null, true); in testInit() 122 assertSame(mContext, cursorAdapter.getContext()); in testInit() 129 cursorAdapter.init(mContext, mCursor, true); in testInit() 130 assertSame(mContext, cursorAdapter.getContext()); in testInit() 148 CursorAdapter cursorAdapter = new MockCursorAdapter(mContext, null); in testGetCount() [all …]
|
D | TimePickerTest.java | 37 private Context mContext; field in TimePickerTest 49 mContext = mInstrumentation.getTargetContext(); in setUp() 55 mContext.getResources().getLayout(com.android.cts.stub.R.layout.timepicker); in testConstructors() 58 new TimePicker(mContext); in testConstructors() 66 new TimePicker(mContext, attrs); in testConstructors() 73 new TimePicker(mContext, null); in testConstructors() 75 new TimePicker(mContext, attrs, 0); in testConstructors() 82 new TimePicker(mContext, null, 0); in testConstructors() 83 new TimePicker(mContext, attrs, 0); in testConstructors() 84 new TimePicker(mContext, attrs, Integer.MIN_VALUE); in testConstructors() [all …]
|
D | ExpandableListViewTest.java | 45 new ExpandableListView(mContext); in testConstructor() 47 new ExpandableListView(mContext, null); in testConstructor() 49 new ExpandableListView(mContext, null, 0); in testConstructor() 54 new ExpandableListView(mContext, attrs); in testConstructor() 55 new ExpandableListView(mContext, attrs, 0); in testConstructor() 77 ExpandableListView expandableListView = new ExpandableListView(mContext); in testSetChildDivider() 78 Drawable drawable = mContext.getResources().getDrawable(R.drawable.scenery); in testSetChildDivider() 83 ExpandableListView expandableListView = new ExpandableListView(mContext); in testSetAdapter() 92 ExpandableListView expandableListView = new ExpandableListView(mContext); in testGetAdapter() 101 ExpandableListView expandableListView = new ExpandableListView(mContext); in testAccessExpandableListAdapter() [all …]
|
D | TextSwitcherTest.java | 31 private Context mContext; field in TextSwitcherTest 45 mContext = getInstrumentation().getContext(); in setUp() 49 new TextSwitcher(mContext); in testConstructor() 51 new TextSwitcher(mContext, null); in testConstructor() 59 TextSwitcher textSwitcher = new TextSwitcher(mContext); in testSetText() 61 TextView tv1 = new TextView(mContext); in testSetText() 62 TextView tv2 = new TextView(mContext); in testSetText() 99 TextSwitcher textSwitcher = new TextSwitcher(mContext); in testSetCurrentText() 101 TextView tv1 = new TextView(mContext); in testSetCurrentText() 102 TextView tv2 = new TextView(mContext); in testSetCurrentText() [all …]
|
D | LinearLayoutTest.java | 40 private Context mContext; field in LinearLayoutTest 51 mContext = getInstrumentation().getTargetContext(); in setUp() 55 new LinearLayout(mContext); in testConstructor() 57 new LinearLayout(mContext, null); in testConstructor() 59 XmlPullParser parser = mContext.getResources().getXml(R.layout.linearlayout_layout); in testConstructor() 61 new LinearLayout(mContext, attrs); in testConstructor() 71 LinearLayout linearLayout = new LinearLayout(mContext); in testAccessBaselineAligned() 93 LinearLayout linearLayout = new LinearLayout(mContext); in testGetBaseline() 95 ListView lv1 = new ListView(mContext); in testGetBaseline() 99 ListView lv2 = new ListView(mContext); in testGetBaseline() [all …]
|
D | SimpleCursorTreeAdapterTest.java | 61 private Context mContext; field in SimpleCursorTreeAdapterTest 70 mContext = getInstrumentation().getTargetContext(); in setUp() 75 new MockSimpleCursorTreeAdapter(mContext, mGroupCursor, in testConstructor() 79 new MockSimpleCursorTreeAdapter(mContext, mGroupCursor, in testConstructor() 83 new MockSimpleCursorTreeAdapter(mContext, mGroupCursor, in testConstructor() 92 mSimpleCursorTreeAdapter = new MockSimpleCursorTreeAdapter(mContext, mGroupCursor, in testBindChildView() 96 TextView view = new TextView(mContext); in testBindChildView() 110 mSimpleCursorTreeAdapter = new MockSimpleCursorTreeAdapter(mContext, mGroupCursor, in testBindGroupView() 113 TextView view = new TextView(mContext); in testBindGroupView() 125 mSimpleCursorTreeAdapter = new MockSimpleCursorTreeAdapter(mContext, mGroupCursor, in testSetViewImage() [all …]
|
D | EditTextTest.java | 35 private Context mContext; field in EditTextTest 42 mContext = getContext(); in setUp() 43 XmlPullParser parser = mContext.getResources().getXml(R.layout.edittext_layout); in setUp() 48 new EditText(mContext); in testConstructor() 50 new EditText(mContext, null); in testConstructor() 52 new EditText(mContext, null, 0); in testConstructor() 54 new EditText(mContext, mAttributeSet); in testConstructor() 56 new EditText(mContext, mAttributeSet, 0); in testConstructor() 78 EditText editText = new EditText(mContext, mAttributeSet); in testAccessText() 91 EditText editText = new EditText(mContext, mAttributeSet); in testSetSelectionIndex() [all …]
|
D | ResourceCursorTreeAdapterTest.java | 37 private Context mContext; field in ResourceCursorTreeAdapterTest 68 mContext = getInstrumentation().getTargetContext(); in setUp() 69 LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService( in setUp() 75 mResourceCursorTreeAdapter = new MockResourceCursorTreeAdapter(mContext, null, in testConstructor() 80 mResourceCursorTreeAdapter = new MockResourceCursorTreeAdapter(mContext, cursor, in testConstructor() 84 new MockResourceCursorTreeAdapter(mContext, null, mCollapsedGroupLayout, in testConstructor() 87 new MockResourceCursorTreeAdapter(mContext, null, mCollapsedGroupLayout, in testConstructor() 90 new MockResourceCursorTreeAdapter(mContext, null, -1, -1); in testConstructor() 92 new MockResourceCursorTreeAdapter(mContext, null, -1, -1, -1); in testConstructor() 94 new MockResourceCursorTreeAdapter(mContext, null, -1, -1, -1, -1); in testConstructor() [all …]
|
/cts/tests/tests/view/src/android/view/cts/ |
D | ViewGroupTest.java | 63 private Context mContext; field in ViewGroupTest 75 mContext = getInstrumentation().getTargetContext(); in setUp() 79 new MockViewGroup(mContext); in testConstructor() 80 new MockViewGroup(mContext, null); in testConstructor() 81 new MockViewGroup(mContext, null, 0); in testConstructor() 85 MockViewGroup vg = new MockViewGroup(mContext); in testAddFocusables() 89 TextView textView = new TextView(mContext); in testAddFocusables() 105 MockViewGroup vg = new MockViewGroup(mContext); in testAddStatesFromChildren() 106 TextView textView = new TextView(mContext); in testAddStatesFromChildren() 117 MockViewGroup vg = new MockViewGroup(mContext); in testAddTouchables() [all …]
|
D | OrientationListenerTest.java | 29 private Context mContext; field in OrientationListenerTest 34 mContext = getContext(); in setUp() 38 new MockOrientationListener(mContext); in testConstructor() 40 new MockOrientationListener(mContext, SensorManager.SENSOR_DELAY_UI); in testConstructor() 45 MockOrientationListener listener = new MockOrientationListener(mContext); in testRegisterationOfOrientationListener() 52 new MockOrientationListener(mContext).onAccuracyChanged(SensorManager.SENSOR_ACCELEROMETER, in testOnAccuracyChanged() 55 new MockOrientationListener(mContext).onAccuracyChanged(SensorManager.SENSOR_ORIENTATION, in testOnAccuracyChanged() 61 MockOrientationListener listener = new MockOrientationListener(mContext); in testOnSensorChanged() 66 new MockOrientationListener(mContext).onSensorChanged(SensorManager.SENSOR_ACCELEROMETER, in testOnSensorChanged() 73 new MockOrientationListener(mContext).onSensorChanged(SensorManager.SENSOR_MAGNETIC_FIELD, in testOnSensorChanged() [all …]
|
/cts/tests/tests/text/src/android/text/format/cts/ |
D | FormatterTest.java | 35 assertEquals("0.00B", Formatter.formatFileSize(mContext, 0)); in testFormatFileSize() 37 assertEquals("899B", Formatter.formatFileSize(mContext, 899)); in testFormatFileSize() 39 assertEquals("1.00KB", Formatter.formatFileSize(mContext, bd.pow(1).longValue())); in testFormatFileSize() 41 assertEquals("1.00MB", Formatter.formatFileSize(mContext, bd.pow(2).longValue())); in testFormatFileSize() 43 assertEquals("1.00GB", Formatter.formatFileSize(mContext, bd.pow(3).longValue())); in testFormatFileSize() 45 assertEquals("1.00TB", Formatter.formatFileSize(mContext, bd.pow(4).longValue())); in testFormatFileSize() 47 assertEquals("1.00PB", Formatter.formatFileSize(mContext, bd.pow(5).longValue())); in testFormatFileSize() 49 assertEquals("1024PB", Formatter.formatFileSize(mContext, bd.pow(6).longValue())); in testFormatFileSize() 52 assertEquals("-1.00B", Formatter.formatFileSize(mContext, -1)); in testFormatFileSize()
|
D | DateUtilsTest.java | 36 private Context mContext; field in DateUtilsTest 41 mContext = getContext(); in setUp() 47 if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) { in testGetDayOfWeekString() 67 if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) { in testGetMonthString() 83 if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) { in testGetAMPMString() 92 if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) { in testGetSpanString() 113 assertNotNull(DateUtils.getRelativeDateTimeString(mContext, in testGetSpanString() 116 assertNotNull(DateUtils.getRelativeTimeSpanString(mContext, in testGetSpanString() 118 assertNotNull(DateUtils.getRelativeTimeSpanString(mContext, in testGetSpanString() 124 if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) { in testFormatMethods() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/p2p/testcase/ |
D | TestCase.java | 49 protected Context mContext; field in TestCase 69 mContext = context; in TestCase() 89 mListener.onTestFailed(mContext.getString(R.string.p2p_setup_error)); in start() 102 mContext.getString(R.string.p2p_unexpected_error)); in start() 145 mP2pMgr = (WifiP2pManager) mContext.getSystemService(Context.WIFI_P2P_SERVICE); in setUp() 146 mWifiMgr = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); in setUp() 147 mChannel = mP2pMgr.initialize(mContext, mContext.getMainLooper(), null); in setUp() 148 mSubChannel = mP2pMgr.initialize(mContext, mContext.getMainLooper(), null); in setUp() 166 mListener.onTestMsgReceived(mContext.getString(id)); in notifyTestMsg() 175 return mContext.getString(R.string.p2p_unexpected_error); in getReason()
|
/cts/tests/ProcessTest/src/com/android/cts/process/ |
D | ProcessTest.java | 38 String testApp = mContext.getPackageName(); in testUid() 39 int uid1 = mContext.getPackageManager().getApplicationInfo(enableApp, in testUid() 41 int uid2 = mContext.getPackageManager().getApplicationInfo(disableApp, in testUid() 43 int uid3 = mContext.getPackageManager().getApplicationInfo(testApp, in testUid() 50 ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); in testPid() 51 String shareProcessName = mContext.getPackageName() + ":shareProcess"; in testPid() 52 String noShareProcessName = mContext.getPackageName() + ":noShareProcess"; in testPid() 57 sharePidIntent.setClass(mContext, SharePidActivity.class); in testPid() 59 mContext.startActivity(sharePidIntent); in testPid() 65 sharePidStubIntent.setClass(mContext, SharePidSubActivity.class); in testPid() [all …]
|
/cts/tests/tests/media/src/android/media/cts/ |
D | RingtoneTest.java | 30 private Context mContext; field in RingtoneTest 41 mContext = getContext(); in setUp() 42 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp() 43 mRingtone = RingtoneManager.getRingtone(mContext, Settings.System.DEFAULT_RINGTONE_URI); in setUp() 55 mDefaultRingUri = RingtoneManager.getActualDefaultRingtoneUri(mContext, in setUp() 71 RingtoneManager.setActualDefaultRingtoneUri(mContext, RingtoneManager.TYPE_RINGTONE, in tearDown() 78 assertNotNull(mRingtone.getTitle(mContext)); in testRingtone() 90 RingtoneManager.setActualDefaultRingtoneUri(mContext, RingtoneManager.TYPE_RINGTONE, null); in testRingtone() 91 mRingtone = RingtoneManager.getRingtone(mContext, Settings.System.DEFAULT_RINGTONE_URI); in testRingtone() 96 Uri uri = RingtoneManager.getValidRingtoneUri(mContext); in testRingtone() [all …]
|
/cts/tests/tests/text/src/android/text/style/cts/ |
D | ImageSpanTest.java | 43 Drawable d = mContext.getResources().getDrawable(R.drawable.pass); in testConstructor() 52 new ImageSpan(mContext, Uri.parse("content://user/a/b")); in testConstructor() 53 new ImageSpan(mContext, Uri.parse("content://user/a/b"), in testConstructor() 55 new ImageSpan(mContext, Uri.parse("content://user/a/b"), in testConstructor() 58 new ImageSpan(mContext, R.drawable.pass); in testConstructor() 59 new ImageSpan(mContext, R.drawable.pass, DynamicDrawableSpan.ALIGN_BOTTOM); in testConstructor() 60 new ImageSpan(mContext, R.drawable.pass, DynamicDrawableSpan.ALIGN_BASELINE); in testConstructor() 73 Drawable d = mContext.getResources().getDrawable(R.drawable.pass); in testGetSource() 83 imageSpan = new ImageSpan(mContext, Uri.parse(source)); in testGetSource() 88 Drawable drawable = mContext.getResources().getDrawable(R.drawable.pass); in testGetDrawable() [all …]
|
/cts/tests/tests/graphics/src/android/graphics/drawable/cts/ |
D | BitmapDrawableTest.java | 48 private Context mContext; field in BitmapDrawableTest 53 mContext = getInstrumentation().getTargetContext(); in setUp() 74 new BitmapDrawable(mContext.getResources()); in testConstructor() 76 new BitmapDrawable(mContext.getResources(), bitmap); in testConstructor() 78 new BitmapDrawable(mContext.getFilesDir().getPath()); in testConstructor() 85 new BitmapDrawable(mContext.getResources(), (String) null); in testConstructor() 89 new BitmapDrawable(mContext.getResources(), (InputStream) null); in testConstructor() 95 InputStream source = mContext.getResources().openRawResource(R.raw.testimage); in testAccessGravity() 111 InputStream source = mContext.getResources().openRawResource(R.raw.testimage); in testSetAntiAlias() 124 InputStream source = mContext.getResources().openRawResource(R.raw.testimage); in testSetFilterBitmap() [all …]
|