Merge "Ensure VcnGatewayConnection#isQuitting never gets unset after being set" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0df66631c0
@@ -578,6 +578,10 @@ public class VcnGatewayConnectionConnectedStateTest extends VcnGatewayConnection
|
||||
mGatewayConnection.teardownAsynchronously();
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
// Verify that sending a non-quitting disconnect request does not unset the isQuitting flag
|
||||
mGatewayConnection.sendDisconnectRequestedAndAcquireWakelock("TEST", false);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
assertEquals(mGatewayConnection.mDisconnectingState, mGatewayConnection.getCurrentState());
|
||||
assertTrue(mGatewayConnection.isQuitting());
|
||||
}
|
||||
|
||||
@@ -127,6 +127,10 @@ public class VcnGatewayConnectionConnectingStateTest extends VcnGatewayConnectio
|
||||
mGatewayConnection.teardownAsynchronously();
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
// Verify that sending a non-quitting disconnect request does not unset the isQuitting flag
|
||||
mGatewayConnection.sendDisconnectRequestedAndAcquireWakelock("TEST", false);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
assertEquals(mGatewayConnection.mDisconnectingState, mGatewayConnection.getCurrentState());
|
||||
assertTrue(mGatewayConnection.isQuitting());
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class VcnGatewayConnectionDisconnectedStateTest extends VcnGatewayConnect
|
||||
true /* isMobileDataEnabled */,
|
||||
mDeps);
|
||||
|
||||
vgc.setIsQuitting(true);
|
||||
vgc.setQuitting();
|
||||
vgc.transitionTo(vgc.mDisconnectedState);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
@@ -102,6 +102,10 @@ public class VcnGatewayConnectionDisconnectedStateTest extends VcnGatewayConnect
|
||||
mGatewayConnection.teardownAsynchronously();
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
// Verify that sending a non-quitting disconnect request does not unset the isQuitting flag
|
||||
mGatewayConnection.sendDisconnectRequestedAndAcquireWakelock("TEST", false);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
assertNull(mGatewayConnection.getCurrentState());
|
||||
verify(mIpSecSvc).deleteTunnelInterface(eq(TEST_IPSEC_TUNNEL_RESOURCE_ID), any());
|
||||
verifySafeModeTimeoutAlarmAndGetCallback(true /* expectCanceled */);
|
||||
|
||||
@@ -79,6 +79,10 @@ public class VcnGatewayConnectionDisconnectingStateTest extends VcnGatewayConnec
|
||||
mGatewayConnection.teardownAsynchronously();
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
// Verify that sending a non-quitting disconnect request does not unset the isQuitting flag
|
||||
mGatewayConnection.sendDisconnectRequestedAndAcquireWakelock("TEST", false);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
// Should do nothing; already tearing down.
|
||||
assertEquals(mGatewayConnection.mDisconnectingState, mGatewayConnection.getCurrentState());
|
||||
verifyTeardownTimeoutAlarmAndGetCallback(false /* expectCanceled */);
|
||||
|
||||
@@ -90,6 +90,10 @@ public class VcnGatewayConnectionRetryTimeoutStateTest extends VcnGatewayConnect
|
||||
.onSelectedUnderlyingNetworkChanged(null);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
// Verify that sending a non-quitting disconnect request does not unset the isQuitting flag
|
||||
mGatewayConnection.sendDisconnectRequestedAndAcquireWakelock("TEST", false);
|
||||
mTestLooper.dispatchAll();
|
||||
|
||||
assertEquals(mGatewayConnection.mDisconnectedState, mGatewayConnection.getCurrentState());
|
||||
verifyRetryTimeoutAlarmAndGetCallback(mFirstRetryInterval, true /* expectCanceled */);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user