summaryrefslogtreecommitdiff
path: root/tests/unit/src/com/android/settings/datausage/DataUsageSummaryPreferenceTest.java
Commit message (Collapse)AuthorAgeFilesLines
* [MS50] Remove NetworkTemplate#buildTemplate* usagesJunyu Lai2022-01-111-4/+2
| | | | | | | | | | This is a no-op refactoring. These functions are deprecated and replaced by NetworkTemplate#Builder, use public API instead. Test: make RunSettingsLibRoboTests Bug: 204830222 Change-Id: Idc2a09d8e3789ca2c7a97691cfad4b2e2b417f0d
* wifi: Use new API for wifi data usage functionlesl2021-05-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | For wifi, a old API: buildTemplateWifiWildcard will includes the merged wifi which is included to mobile usage. It should not double count again. Call new API: buildTemplateWifi with NetworkId: NetworkTemplate.WIFI_NETWORKID_ALL and null subscriberId to get non-merged wifi usage. Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppDataUsageTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppDataUsagePreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageSummaryPreferenceControllerTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageUtilsTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=SettingsDumpServiceTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiSettingsTest Test: make RunSettingsRoboTests ROBOTEST_FILTER=DataUsageInfoControllerTest Test: Manual Test, wifi data usage count correctly. Bug: 176396812 Change-Id: Ia4d8fa67ea3cb75c2d35be9ab60e5c5ffa391ffb
* DataUsageSummaryPreferenceTest converted to JUnitJeremy Goldman2020-12-211-0/+571
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