Commit Graph

666 Commits

Author SHA1 Message Date
Betty Chang
090f32f03d Merge "[Testing] Use AndroidJUnit4 instead in CarrierSettingsVersionPreferenceControllerTest" 2020-09-15 02:37:19 +00:00
Jeremy Goldman
ca5aa8786d [Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest
Diff: https://diff.googleplex.com/#key=OYsSkuGzJNkP
Test: atest -c MobileDataPreferenceControllerTest
Merged-In: I1a2d7b38023681f3db3320aa9f315109280cfbd0
Change-Id: Ica6625bb924ad0e813b4f9cdca62b0126b63214e
2020-09-15 10:36:14 +08:00
Jeremy Goldman
d713cc6873 [Testing] use AndroidJUnit4 in new MultiNetworkHeaderControllerTest
1. Rather than mocking the PreferenceScreen, create an instance via
PreferenceManager. Rather than stubbing PreferenceScreen functions to
return the PreferenceCategory mock, the mock is inserted using public
functions.
2. PreferenceCategory active state is checked rather than verifying the
arguments of function calls.
3. mHeaderController test superclass overrides functions which use the
Lifecycle, because doReturn+when on Spy objects has undesired side
effects.
4. Looper message queue prepared for the PreferenceScreen.

Bug: 168130550
Diff: https://diff.googleplex.com/#key=w7a7L3seOowE
Test: atest -c MultiNetworkHeaderControllerTest
Merged-In: Ic66425aca4047d2eacd04509f3bfb315f6dd57fc
Change-Id: I07925cfbb05636bdf7f0efe1811405a01dcf6523
2020-09-15 10:34:24 +08:00
changbetty
3644df3a9e [Testing] Use AndroidJUnit4 instead in DataUsageInfoControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Rename the test case for apply the naming rule

Bug: 167948471
Test: atest -c DataUsageInfoControllerTest
Change-Id: Id8591f77d6ab2840223501962ae19eaa2749f326
2020-09-14 18:31:43 +08:00
Jeremy Goldman
1f718138e5 Merge "[Testing] use AndroidJUnit4 in new MultiNetworkHeaderControllerTest" 2020-09-11 17:38:52 +00:00
Jeremy Goldman
9b8efdbe4c Merge "[Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest" 2020-09-11 17:38:18 +00:00
Betty Chang
b5cc1860f3 Merge "[Testing] Use AndroidJUnit4 instead in MmsMessagePreferenceControllerTest" 2020-09-11 09:50:06 +00:00
changbetty
018ab8e800 [Testing] Use AndroidJUnit4 instead in CarrierSettingsVersionPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Change the Copy Right
3. Remove the shadowCarrierConfigManager to mock the
CarrierConfigManager

Bug: 168281601
Test: atest -c CarrierSettingsVersionPreferenceControllerTest
Change-Id: Id14d103a82d2d2954721624ed7a16204ee0f25b6
2020-09-11 08:45:03 +00:00
Betty Chang
4c8756704c Merge "[Testing] Use AndroidJUnit4 instead in AppPrefLoaderTest" 2020-09-11 08:38:59 +00:00
changbetty
866f40b2f6 [Testing] Use AndroidJUnit4 instead in MmsMessagePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Change the Copy Right
3. Remove the ShadowSubscriptionManager

Bug: 168278301
Test: atest -c MmsMessagePreferenceControllerTest
Change-Id: Ie2e9c99f9899d422fde41fcd6cf4a918bc0eaf98
2020-09-11 14:52:28 +08:00
changbetty
5a22464bfa [Testing] Use AndroidJUnit4 instead in AppPrefLoaderTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Change the Copy Right

Bug: 168277399
Test: atest -c AppPrefLoaderTest
Change-Id: If4c79ae1831bd531c7e4f0a068f06a592418d7fe
2020-09-11 06:36:54 +00:00
Jeremy Goldman
a1aaccf670 [Testing] use AndroidJUnit4 in new MultiNetworkHeaderControllerTest
1. Rather than mocking the PreferenceScreen, create an instance via
PreferenceManager. Rather than stubbing PreferenceScreen functions to
return the PreferenceCategory mock, the mock is inserted using public
functions.
2. PreferenceCategory active state is checked rather than verifying the
arguments of function calls.
3. mHeaderController test superclass overrides functions which use the
Lifecycle, because doReturn+when on Spy objects has undesired side
effects.
4. Looper message queue prepared for the PreferenceScreen.

Bug: 168130550
Diff: https://diff.googleplex.com/#key=w7a7L3seOowE
Test: atest -c MultiNetworkHeaderControllerTest
Change-Id: Ic66425aca4047d2eacd04509f3bfb315f6dd57fc
2020-09-10 20:10:22 +00:00
Jeremy Goldman
4126ec2d32 [Testing] use AndroidJUnit4 in new EuiccPreferenceControllerTest
Test: atest -c EuiccPreferenceControllerTest
Change-Id: I028ca81d38252beb3abccef9e938988510f3f55e
2020-09-10 15:19:01 +00:00
Jeremy Goldman
ff6bc3ce27 [Testing] use AndroidJUnit4 in new MobileDataPreferenceControllerTest
Diff: https://diff.googleplex.com/#key=OYsSkuGzJNkP
Test: atest -c MobileDataPreferenceControllerTest
Change-Id: I1a2d7b38023681f3db3320aa9f315109280cfbd0
2020-09-10 15:15:08 +00:00
Betty Chang
e8b877e3ee Merge "[Testing] Use AndroidJUnit4 instead in NetworkDashboardFragmentTest" 2020-09-10 02:30:24 +00:00
Betty Chang
914fdb6b5f Merge "[Testing] Use AndroidJUnit4 instead in MobilePlanPreferenceControllerTest" 2020-09-10 02:30:09 +00:00
changbetty
0bf90f7186 [Testing] Use AndroidJUnit4 instead in MobilePlanPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Add @Before setup() for context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found

Bug: 167997296
Test: atest -c MobilePlanPreferenceControllerTest
Change-Id: I5f43b6a4d20108195164038c02810b725abbcd06
2020-09-09 15:34:52 +08:00
changbetty
f24a8be2d8 [Testing] Use AndroidJUnit4 instead in NetworkDashboardFragmentTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Run the NetworkDashboardFragment on the Main thread

Bug: 168000627
Test: atest -c NetworkDashboardFragmentTest
Change-Id: I6d10737b9ac8299f2d7c847a9fdb1c3bdc4e390d
2020-09-09 11:26:42 +08:00
Betty Chang
4badae1a03 Merge "[Testing] Use AndroidJUnit4 instead in DataServiceSetupPreferenceControllerTest" 2020-09-08 01:45:08 +00:00
Betty Chang
b05056bce7 Merge "[Testing] Use AndroidJUnit4 instead in DisableSimFooterPreferenceControllerTest" 2020-09-08 01:44:17 +00:00
Betty Chang
9928db2e7e Merge "[Testing] Use AndroidJUnit4 instead in PreferredNetworkModePreferenceControllerTest test files" 2020-09-08 01:35:45 +00:00
Betty Chang
13aa43c2f8 Merge "[Testing] Use AndroidJUnit4 instead in telephony/gsm/ test files" 2020-09-08 01:33:51 +00:00
Betty Chang
645da1dac4 Merge "[Testing] Use AndroidJUnit4 instead in NrDisabledInDsdsFooterPreferenceControllerTest" 2020-09-07 09:34:56 +00:00
changbetty
bc7475a08f [Testing] Use AndroidJUnit4 instead in telephony/gsm/ test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found

Bug:
Test: atest -c AutoSelectPreferenceControllerTest
      atest -c OpenNetworkSelectPagePreferenceControllerTest
Change-Id: Ic80da4fcc6a64e7fde55705dda128741c26ce3cf
2020-09-07 02:31:30 +00:00
changbetty
ca2e8c8250 [Testing] Use AndroidJUnit4 instead in NrDisabledInDsdsFooterPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Remove the @Ignore tag in isAvailable_dataOnAndDsdsAnd5GSupported_Available

Bug: 167933210
Test: atest -c NrDisabledInDsdsFooterPreferenceControllerTest
Change-Id: I455a543d7a006be21523918e48cc77b403f8b56d
2020-09-07 09:27:17 +08:00
Betty Chang
fd1f4cba36 Merge "[Testing] Use AndroidJUnit4 instead in TelephonyBasePreferenceControllerTest" 2020-09-07 00:35:18 +00:00
changbetty
6a66732801 [Testing] Use AndroidJUnit4 instead in DataServiceSetupPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 167386055
Test: atest -c DataServiceSetupPreferenceControllerTest
Change-Id: I06b4e9a99336e68af954138457b602061c776baa
2020-09-01 22:30:53 +08:00
changbetty
0d220e600d [Testing] Use AndroidJUnit4 instead in DisableSimFooterPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 167383385
Test: atest -c DisableSimFooterPreferenceControllerTest
Change-Id: Ic725be35c4ecd44006919a74cfeab3febc6e3532
2020-09-01 14:14:10 +00:00
changbetty
7644e35698 [Testing] Use AndroidJUnit4 instead in PreferredNetworkModePreferenceControllerTest test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Workaround the resource getString to resolve the resource not found
5. Add @After to reset the content provider data

Bug: 167377501
Test: atest -c PreferredNetworkModePreferenceControllerTest
Change-Id: I8c123747a59eb4cf6c6b8b73109cf00cef4515f0
2020-09-01 13:42:30 +00:00
Xin Li
748efff856 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ie9d2c4d6d4618a167af1c5627d5d7918a404f398
Change-Id: I2ae428e37fd96226ce4e06032e2c0beaacbd0301
2020-08-28 23:35:54 -07:00
Jeff DeCew
b409b64045 Update NotificationChannelSettings Preferences in place to prevent re-layout.
Fixes: 110093185
Test: ChannelListPreferenceControllerTest
Change-Id: If6acf305c44085e502a3304ea57e409ce049b40f
2020-08-24 15:11:22 -04:00
Betty Chang
dd6f6fdb64 Merge "[Testing] Use AndroidJUnit4 instead in ApnPreferenceControllerTest" 2020-08-20 08:28:15 +00:00
changbetty
6f53c94b9a [Testing] Use AndroidJUnit4 instead in ApnPreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right

Bug: 165232573
Test: atest -c ApnPreferenceControllerTest
Change-Id: Iab7f648061bab9ea33f6a15231be2344be6b3499
2020-08-20 14:13:46 +08:00
Betty Chang
0ab88f263d Merge "[Testing] Use AndroidJUnit4 instead in MobileNetworkUtilsTest" 2020-08-20 04:15:36 +00:00
Betty Chang
19a7ddd02b Merge "[Testing] Use AndroidJUnit4 instead in TelephonyTogglePreferenceControllerTest" 2020-08-18 10:27:32 +00:00
changbetty
fc29bdedc7 [Testing] Use AndroidJUnit4 instead in MobileNetworkUtilsTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right
4. Create the real object for PhoneAccountHandle and ComponentName

Bug: 164989754
Test: atest -c MobileNetworkUtilsTest
Change-Id: I1778832b0602062adb24928343c0c1d0e525942d
2020-08-18 16:18:56 +08:00
changbetty
d2e9e42f32 [Testing] Use AndroidJUnit4 instead in TelephonyTogglePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change the Copy Right

Bug: 164986958
Test: atest -c TelephonyTogglePreferenceControllerTest
Change-Id: I3d6c39f45cb1efb1742148f20f03372214eb0cbe
2020-08-17 12:41:53 +00:00
changbetty
933e4df3c9 [Testing] Use AndroidJUnit4 instead in TelephonyBasePreferenceControllerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right

Bug: 164986221
Test: atest -c TelephonyBasePreferenceControllerTest
Change-Id: Iabe24aef0b7a5c3aa9d7be275f0c4ed552cdd2e8
2020-08-17 12:41:20 +00:00
Betty Chang
1adaa8ba27 Merge "[Testing] Use AndroidJUnit4 instead in SubscriptionUtilTest" 2020-08-17 10:46:30 +00:00
changbetty
57abc1f865 [Testing] Use AndroidJUnit4 instead in SubscriptionUtilTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Add spy context and get the SubscriptionManager and TelephonyManager
from the spy context

Bug: 163298785
Test: atest -c SubscriptionUtilTest
Change-Id: Iefcf29904c9c4475221c20318526ce48cb88a45a
2020-08-17 11:57:22 +08:00
Bonian Chen
6f5e9d1ee2 Merge "[Settings] Grant permissions to submit junit test" am: 33e4971820 am: af57413abc am: 45cc4bbe61 am: 454bcb012e am: a716d48ffc
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1398398

Change-Id: I41e6a4e0604d9fe051fdb8168287c53a8da763c8
2020-08-14 09:13:01 +00:00
Bonian Chen
45cc4bbe61 Merge "[Settings] Grant permissions to submit junit test" am: 33e4971820 am: af57413abc
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1398398

Change-Id: I1e5921c9a4cc5b223d0ee61eae2cac7afaa19e2a
2020-08-14 08:20:48 +00:00
Betty Chang
18c9d1db3f Merge "[Testing] Use AndroidJUnit4 instead in GlobalSettingsChangeListenerTest" 2020-08-13 13:19:59 +00:00
Bonian Chen
1c97e70641 [Settings] Grant permissions to submit junit test
Grant permissions for adding new Junit test case.

Change-Id: Iabde2307669815fd50cdba241492c82b9e2cf64d
2020-08-13 18:49:31 +08:00
changbetty
7f94b4dbb9 [Testing] Use AndroidJUnit4 instead in GlobalSettingsChangeListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Add new TestListener for spy GlobalSettingsChangeListener

Bug: 163299183
Test: atest -c GlobalSettingsChangeListenerTest
Change-Id: I0290470d3d3b235e0069ecbb9c1ce87a705d71d1
2020-08-13 18:24:49 +08:00
SongFerngWang
4ba7007aba Add AirplaneModePreferenceControllerTest at Androidx.Test
Bug: 161875909
Test: atest AirplaneModePreferenceControllerTest (PASS)
Change-Id: Id1c50824fa420d958fcc45f80aba30a360c40b94
2020-08-13 17:32:13 +08:00
Edgar Wang
a8742aa7ab Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: robotest & manual
Change-Id: Ia8625091a107fc3fb652d3ba3f75ea3cc1a8d9f5
2020-08-12 11:29:07 +08:00
changbetty
7f57ef4766 [Testing] Use AndroidJUnit4 instead in DataConnectivityListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context

Bug: 162048313
Test: atest -c DataConnectivityListenerTest
Change-Id: I8f05ac7f5f14cb2b990da137099a22e4a89fcc37
2020-08-11 15:32:58 +08:00
changbetty
c3aa6d26ee [Testing] Remove Robolectric import and use AndroidJUnit4 instead in MobileDataEnabledListenerTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context

Bug: 162048313
Test: atest -c MobileDataEnabledListenerTest
Change-Id: I81b3d6ac075666a45649c8d811832a40bdb1b41b
2020-08-05 22:53:29 +08:00
markchien
77c297df4f Remove unused resource from TetherServiceTest
TetherService is no longer query resource by itself after ag/11524847.
That CL miss to remove unused getResources code.
Now remove unused resource in this change.

Bug: 146918263
Test: atest TetherServiceTest
Change-Id: I3b0da2672246997aee16b11576ce5ae9bfe596dc
Merged-In: I3b0da2672246997aee16b11576ce5ae9bfe596dc
2020-06-19 23:23:02 +08:00