From 99a17f99aff55b3dbd9b2469bacfce106bfbd97d Mon Sep 17 00:00:00 2001 From: Yuyang Huang Date: Tue, 8 Oct 2024 18:34:57 +0900 Subject: [PATCH] Validate cellular network in testSetAvoidUnvalidated() for accurate testing * Modified testSetAvoidUnvalidated() to ensure the cellular network is validated before proceeding with default network switching tests. * This prevents inaccurate test results when the cellular network is not usable, as the connectivity service won't switch to it if the Wi-Fi network becomes invalid. Bug: 371818866 Test: TH Change-Id: I458903392605a44470d5f226a36cfa983ec71aea --- tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java index b62db04eb2..0e9ea0c552 100644 --- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java +++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java @@ -3061,6 +3061,7 @@ public class ConnectivityManagerTest { try { final Network cellNetwork = networkCallbackRule.requestCell(); + ensureCellIsValidatedBeforeMockingValidationUrls(); final Network wifiNetwork = prepareValidatedNetwork(); final TestableNetworkCallback defaultCb =