Commit Graph

527 Commits

Author SHA1 Message Date
tom hsu
2fd7c9ffd1 [Settings] Refractor ApnSettings code to independent package folder.
Bug: 169750507
Test: make RunSettingsRoboTests
Change-Id: I8b2709ba8d16c625863d8a17abc3d0ab5d019bb8
2020-09-30 15:56:01 +00:00
Betty Chang
e8fa746299 Merge "[Testing] Use AndroidJUnit4 instead in CellDataPreferenceTest" 2020-09-30 06:12:31 +00:00
Betty Chang
40bc88e8ab Merge "[Testing] Use AndroidJUnit4 instead in telephony/cdma/ test files" 2020-09-29 01:56:14 +00:00
Alexander Dorokhine
46e85a2fad Migrate away from deprecated Truth APIs.
This is a transitional step towards truth 1.0.1, where these APIs have
been completely removed.

Bug: 168765701
Test: m checkbuild
Change-Id: I76f9c37cb699ce6ab8715ffe35d11668ccbceea1
2020-09-24 23:09:41 +00:00
Jeremy Goldman
6620c84d89 create junit MobileNetworkPreferenceControllerTest.
1. androidx lifecycle used rather than settingslib wrapper. This allows
us to handle lifecycle events from junit tests as well.
2. Use Mocks or get/set functions rather than robolectric shadows.

MobileNetworkPreferenceControllerTest Diff:
    https://diff.googleplex.com/#key=5P0b2G4iYmcz
Test: atest -c MobileNetworkPreferenceControllerTest
Change-Id: If49fe64e5db89a0cdcac7d26329b8c18626a00de
2020-09-23 17:26:14 +00:00
changbetty
c707b90d0a [Testing] Use AndroidJUnit4 instead in telephony/cdma/ test files
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. To get the original value and add @After to restore the data

Bug:
Test: atest -c CdmaListPreferenceTest
      atest -c CdmaSubscriptionPreferenceControllerTest
      atest -c CdmaSystemSelectPreferenceControllerTest
Change-Id: I110727b643a6755ee888708bd1fb2a39cf524a2d
2020-09-23 17:46:30 +08:00
changbetty
9e78b620d3 [Testing] Use AndroidJUnit4 instead in CellDataPreferenceTest
1. Use AndroidJunit4 instead of RobolectricTestRunner
2. Use ApplicationProvider instead of RuntimeEnvironment to get context
3. Change Copy Right
4. Remove the PreferenceViewHolder that not used in test
5. Remove the ProxySubscriptionManager that can get the real object by
context

Bug: 168767478
Test: atest -c CellDataPreferenceTest
Change-Id: I1fa5747c8c6d224d6b13f1a693ff88e57fd150d3
2020-09-23 16:30:59 +08:00
Jeremy Goldman
37cfec7ac2 Merge "[Testing] AndroidJunit Enhanced4gLteSliceHelperTest" 2020-09-21 03:46:18 +00:00
Jeremy
1885f027d8 [Testing] AndroidJunit Enhanced4gLteSliceHelperTest
Test: atest -c Enhanced4gLteSliceHelperTest
Change-Id: I548ffe60f00cea76d0c4af33ca4ec6f38cbf6247
2020-09-18 15:30:41 -04:00
Jeremy Goldman
d620baa3d7 Merge "[Testing] AndroidJUnit4 NetworkSelectSettingsTest" 2020-09-17 18:58:36 +00:00
Jeremy Goldman
7cb2738fdb [Testing] AndroidJUnit4 NetworkSelectSettingsTest
Test: atest -c NetworkSelectSettingsTest
Change-Id: I1d842cd522df87d1cc762b50ae43e9efc723b154
2020-09-17 16:08:33 +00:00
Jeremy Goldman
953ed3dcd2 Merge "[Testing] AndroidJUnit4 RoamingPreferenceControllerTest" 2020-09-16 00:48:31 +00:00
Jeremy Goldman
b1f8405a83 [Testing] AndroidJUnit4 RoamingPreferenceControllerTest
Test: atest -c RoamingPreferenceControllerTest
Change-Id: I155b1c36381b65d23ca1745e72a6f8388f6909e3
2020-09-15 19:53:54 +00:00
Betty Chang
195aa70291 Merge "[Testing] Use AndroidJUnit4 instead in DataUsageInfoControllerTest" 2020-09-15 06:17:53 +00:00
Betty Chang
090f32f03d Merge "[Testing] Use AndroidJUnit4 instead in CarrierSettingsVersionPreferenceControllerTest" 2020-09-15 02:37:19 +00: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
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