Rather than mocking the PreferenceScreen's getPreference function,
a PreferenceManager has been created, which instantiates the Screen.
The desired Preference is added to the Screen with the testing key.
Rather than using a shadow XML, contexts' resources are mocked.
A mock WifiManager is used instead of a shadow
Duplicate test case removed, and test which succeeds locally but
not on cuttlefish marked as ignored for now.
Bug: 175389659
Test: atest -c DeviceNamePreferenceControllerTest
Change-Id: I643b22993a1d102614fed1883af7f4925947be20
There are couple of newly explored concepts in this CL, which will
hopefully be useful for migrating other tests in the future as well. In
broad strokes, the changes to this file cover:
Android build file species the preferences library, in order to access
PreferenceViewHolder.createInstanceForTests.
Resource ids in JUnit tests differ from the Settings apk. This is true
not only of strings but also views and layouts. Helper functions added
to main class to access the layouts needed by the test.
Shadow activities are not needed to view layouts, the context can be
used.
Context startActivity can be mocked and verified in order to capture and
examine the intent created by the library under test.
Bug: 175389659
Test: atest -c DataUsageSummaryPreferenceTest
Change-Id: Ib8cb87f0299c47a32c3f5d3af7edb20592b727ec
The superclass ContentProvider's "getContext" method is final and
cannot be mocked, so a helper method visible for testing was added
to allow for context injection.
Bug: 175389659
Test: atest -c ModuleLicenseProviderTest
Change-Id: I9e20171340ae0a48d74fae44c7b356ea67dba43b
Connection through new CDS APIs to come once that CL is merged.
Bug: 168065315
Test: atest SettingsUnitTests:com.android.settings.accessibility.ReduceBrightColorsIntensityPreferenceControllerTest
Change-Id: I9cc6a20ea5ea8a11c5fb3ef8a36e372d9c12b4bc
Set default "ON" when we can not get
SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED value.
Bug: 175084985
Test: manual check Settings > System > Gesture > Swipe for notifications
Test: manual check it is disabled after One-handed mode toggled on
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
"SwipeBottomToNotificationSettingsTest"
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
"SwipeBottomToNotificationPreferenceControllerTest"
Change-Id: I176ba1c0e18c5ed7d1582d380db6ec190b6e1dec
canSubscriptionBeDisplayed is more readable.
Reasonale:
When cherry-picking ag/12886476 into Android R branch (ag/13209427), a comment from code reviewer suggested this change.
Since ag/12886476 has been merged for a while, another patch for it is perferred option when comparing with reverting that CL and resubmit it.
Bug: 175830728
Change-Id: Ie91eb82504fd7cff6671803a2bc2560139690952
Test: build pass
Merged-In: Ie91eb82504fd7cff6671803a2bc2560139690952
canSubscriptionBeDisplayed is more readable.
Reasonale:
When cherry-picking ag/12886476 into Android R branch (ag/13209427), a comment from code reviewer suggested this change.
Since ag/12886476 has been merged for a while, another patch for it is perferred option when comparing with reverting that CL and resubmit it.
Bug: 175830728
Change-Id: Ie91eb82504fd7cff6671803a2bc2560139690952
Test: build pass
Some carrier(s) expand their service through providing eSIM in companion
with pSIM. Group UUID is designed to group them together as a single
SIM.
Bug: 169455114
Bug: 175069803
Test: make RunSettingsRoboTests ROBOTEST_FILTER=SubscriptionsPreferenceControllerTest
Change-Id: I0934a45a2917ab106627c733162efbee9a13f216
(cherry picked from commit a6b249d625)
Merged-In: I0934a45a2917ab106627c733162efbee9a13f216
Add goldmanj to tests/unit for junit migration and
utility library creation
Add connectivity settings eng to settings/datausage.
Test: N/A, just owners update
Change-Id: I182ad6093677dc151b171d9e5aaa15cdd353c474
This change do the 2 things:
1. Add new junit tests files which replace robolectric
RobolectricTestRunner & RuntimeEnvironment with
AndroidX objects without problem.
2. Remove the robolectric test files which have it's new junit files.
This change migrate 103 files, there are still 1209
files to go.
Bug: 174728471
Test: atest
make RunSettingsRoboTests
Change-Id: I15ed3f4745b85862f720aabbf710ce1475aced93
When configuring CBRS profiles this dialog / notification will be
dismissed after configuration is done, to avoid confusion.
Bug: 142092510
Test: manual and unittest
Change-Id: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
Merged-In: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
When configuring CBRS profiles this dialog / notification will be
dismissed after configuration is done, to avoid confusion.
Bug: 142092510
Test: manual and unittest
Change-Id: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
Merged-In: Iaf30062f555ec2c119c4aafd6aa013e73b5253f0
Instead of reading as one hundred and ten, it should read as one-one-o.
Also make the number override dialog text input box a little bigger
Fix: 175517632
Fix: 175514672
Test: robotests
Change-Id: I7e3e823792f885004868ede790fc414a3fa66f01
With CL[1], the isImeTraceEnabled in InputMethodManager
require to use ResultCallback mechanism. Change this API
usage in DevelopmentTiles.
[1] : I1547b98b2aacf764e33aadc9ab784f2013f58f2f
Bug: 163453493
Test: make RunSettingsRoboTests ROBOTEST_FILTER="WinscopeTraceTest"
Change-Id: I767069892c713023b064525105ef2b55946b7bb8
Before the JUnit test suite was a blocking presubmit, new junit tests
would be written without removing the old robolectric test. Now that the
JUnit tests are productionized, we can remove the robolectric tests if
there is also an associated Junit one.
Utility script which was used to generate this list can be found at
https://paste.googleplex.com/5113068112576512.
Bug: 175389659
Test: atest SettingsUnitTests
Change-Id: Iabf4dbcccd573e9e1482b3a3e61c0f169f81bcb4