summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/NetworkProviderTest.kt
Commit message (Collapse)AuthorAgeFilesLines
* Mark connectivity module tests as suchRemi NGUYEN VAN2022-01-181-0/+2
| | | | | | | | | | | | | | | | Add @ConnectivityModuleTest to tests for classes that are mainly used to back the connectivity (tethering) module, in particular data classes. This causes the test not to be run in NetworkStack/CaptivePortalLogin MTS tests when the connectivity (tethering) module is not installed. Skipping such tests is necessary in that configuration as they may test behavior that is new in the latest update, and data classes backing the connectivity module would not be affected by NetworkStack/CaptivePortalLogin updates anyway. Bug: 211075897 Test: atest CtsNetTestCasesLatestSdk Change-Id: I6163cd998fc78765b903fdb7acd21e652bc711c9
* Add NetworkProviderTest#testRegisterNetworkOffer back into testChiachang Wang2021-12-271-2/+0
| | | | | | | | | | This test was temporarily disabled because prebuilt module is not updated in the branch. Now the prebuilt was S already, so add the test back to test to ensure the coverage. Test: atest FrameworksNetTests CtsNetTestCases Bug: 189074532 Change-Id: I510f457d2869c2904404fe7ef55828e84636e4c5
* Temporarily disable the test since prebuilt module is not updatedJunyu Lai2021-07-201-0/+2
| | | | | | | | | | This CL is subject to be reverted in a few days when the prebuilt Connectivity module is updated. Ignore-AOSP-First: This is for sc-dev and its downstreams only Test: android.net.NetworkProviderTest Bug: 189074532 Change-Id: I512552400960668c0ba91a8d997d1e2747209538
* Consider NetworkOffer is unneeded if it cannot satisfy the requestJunyu Lai2021-07-201-6/+4
| | | | | | | | | | | | | | | | | | | | | Currently, to prevent from network connect-teardown-loops that caused by inaccurate reports, e.g. the provider always provides a better network than the offer, the NetworkOffer is considered needed if its provider is currently serving the request. This is because there is no accurate way to know whether the offer is corresponding to the network that is currently serving the request. However, if the offer cannot even satisfies the request, consider the offer is needed does not make any sense. Since it can never be the one that currently serving the request, nor be the one that might beat current satisfier. Test: android.net.NetworkProviderTest Bug: 189074532 Original-Change: https://android-review.googlesource.com/1731452 Merged-In: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd Change-Id: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd
* Add CTS for registerNetworkOfferJunyu Lai2021-06-211-4/+180
| | | | | | | | | Test: android.net.NetworkProviderTest on R/S device Bug: 189074532 Original-Change: https://android-review.googlesource.com/1731451 Merged-In: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933 Change-Id: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933
* Fix expectCallback does not fail when no callback receivedJunyu Lai2021-06-171-5/+26
| | | | | | | | | | | | | | | | | | | | This hides 3 bugs where, 1. In Android S, onNetworkRequested is no longer broadcasted by ConnectivityService in any condition. However, the test still passes since assertion does not fail when no callback received. Ignore the test on S+ devices since the behavior changed on S or later devices. 2. Test network agent is not registered, but the test still passes. 3. Test network agent does not fulfill the request that kept the network up, so the test fails since the test network is not needed and be torn down. Test: android.net.NetworkProviderTest on R/S device Bug: 189074532 Merged-In: I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055 Change-Id: I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055 (cherry-picked from aosp/1731450)
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-0/+201
Move the tests together with packages/Connectivity code, so both can be moved to packages/modules/Connectivity together. Also reorganize unit tests in a unit/ directory, as other tests (integration/, common/ etc.) have been added in tests/net since they were created. This makes the directory structure consistent. Test: atest FrameworksNetTests Bug: 187814163 Ignore-AOSP-First: needs per-branch move for merge conflicts Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc