Merge "Clean up for multiple validation result update" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4d6330deae
@@ -615,7 +615,7 @@ public class ConnectivityServiceTest {
|
|||||||
private void onValidationRequested() {
|
private void onValidationRequested() {
|
||||||
try {
|
try {
|
||||||
if (mNmProvNotificationRequested
|
if (mNmProvNotificationRequested
|
||||||
&& mNmValidationResult == VALIDATION_RESULT_VALID) {
|
&& ((mNmValidationResult & NETWORK_VALIDATION_RESULT_VALID) != 0)) {
|
||||||
mNmCallbacks.hideProvisioningNotification();
|
mNmCallbacks.hideProvisioningNotification();
|
||||||
mNmProvNotificationRequested = false;
|
mNmProvNotificationRequested = false;
|
||||||
}
|
}
|
||||||
@@ -2781,10 +2781,10 @@ public class ConnectivityServiceTest {
|
|||||||
// Bring up a network with a captive portal.
|
// Bring up a network with a captive portal.
|
||||||
// Expect onAvailable callback of listen for NET_CAPABILITY_CAPTIVE_PORTAL.
|
// Expect onAvailable callback of listen for NET_CAPABILITY_CAPTIVE_PORTAL.
|
||||||
mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
|
mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI);
|
||||||
String firstRedirectUrl = "http://example.com/firstPath";
|
String redirectUrl = "http://android.com/path";
|
||||||
mWiFiNetworkAgent.connectWithCaptivePortal(firstRedirectUrl);
|
mWiFiNetworkAgent.connectWithCaptivePortal(redirectUrl);
|
||||||
captivePortalCallback.expectAvailableCallbacksUnvalidated(mWiFiNetworkAgent);
|
captivePortalCallback.expectAvailableCallbacksUnvalidated(mWiFiNetworkAgent);
|
||||||
assertEquals(mWiFiNetworkAgent.waitForRedirectUrl(), firstRedirectUrl);
|
assertEquals(mWiFiNetworkAgent.waitForRedirectUrl(), redirectUrl);
|
||||||
|
|
||||||
// Check that startCaptivePortalApp sends the expected command to NetworkMonitor.
|
// Check that startCaptivePortalApp sends the expected command to NetworkMonitor.
|
||||||
mCm.startCaptivePortalApp(mWiFiNetworkAgent.getNetwork());
|
mCm.startCaptivePortalApp(mWiFiNetworkAgent.getNetwork());
|
||||||
@@ -2794,7 +2794,7 @@ public class ConnectivityServiceTest {
|
|||||||
// Report that the captive portal is dismissed with partial connectivity, and check that
|
// Report that the captive portal is dismissed with partial connectivity, and check that
|
||||||
// callbacks are fired.
|
// callbacks are fired.
|
||||||
mWiFiNetworkAgent.setNetworkPartial();
|
mWiFiNetworkAgent.setNetworkPartial();
|
||||||
mWiFiNetworkAgent.mNetworkMonitor.forceReevaluation(Process.myUid());
|
mCm.reportNetworkConnectivity(mWiFiNetworkAgent.getNetwork(), true);
|
||||||
waitForIdle();
|
waitForIdle();
|
||||||
captivePortalCallback.expectCapabilitiesWith(NET_CAPABILITY_PARTIAL_CONNECTIVITY,
|
captivePortalCallback.expectCapabilitiesWith(NET_CAPABILITY_PARTIAL_CONNECTIVITY,
|
||||||
mWiFiNetworkAgent);
|
mWiFiNetworkAgent);
|
||||||
@@ -2805,6 +2805,7 @@ public class ConnectivityServiceTest {
|
|||||||
false /* always */);
|
false /* always */);
|
||||||
waitForIdle();
|
waitForIdle();
|
||||||
mCm.reportNetworkConnectivity(mWiFiNetworkAgent.getNetwork(), true);
|
mCm.reportNetworkConnectivity(mWiFiNetworkAgent.getNetwork(), true);
|
||||||
|
captivePortalCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent);
|
||||||
validatedCallback.expectAvailableCallbacksValidated(mWiFiNetworkAgent);
|
validatedCallback.expectAvailableCallbacksValidated(mWiFiNetworkAgent);
|
||||||
NetworkCapabilities nc =
|
NetworkCapabilities nc =
|
||||||
validatedCallback.expectCapabilitiesWith(NET_CAPABILITY_PARTIAL_CONNECTIVITY,
|
validatedCallback.expectCapabilitiesWith(NET_CAPABILITY_PARTIAL_CONNECTIVITY,
|
||||||
|
|||||||
Reference in New Issue
Block a user