Support losing the upstream in IpServerTest.
Allow dispatchTetherConnectionChanged to pass in a null upstream interface and/or null LinkProperties. This will allow future tests to check what happens when the upstream interface goes away. Bug: 149963652 Test: test-only change Change-Id: I7cfc32d072f23644159d33700d6cd830c426ea19 Merged-In: I7cfc32d072f23644159d33700d6cd830c426ea19 (cherry picked from commit 62457f17e72c7ef0bee5c5bb1a04935a549b9fe6)
This commit is contained in:
committed by
Lorenzo Colitti
parent
1131b744f0
commit
230178c6af
@@ -624,16 +624,15 @@ public class IpServerTest {
|
|||||||
* @param v6lp IPv6 LinkProperties of the upstream interface, or null for an IPv4-only upstream.
|
* @param v6lp IPv6 LinkProperties of the upstream interface, or null for an IPv4-only upstream.
|
||||||
*/
|
*/
|
||||||
private void dispatchTetherConnectionChanged(String upstreamIface, LinkProperties v6lp) {
|
private void dispatchTetherConnectionChanged(String upstreamIface, LinkProperties v6lp) {
|
||||||
mIpServer.sendMessage(IpServer.CMD_TETHER_CONNECTION_CHANGED,
|
dispatchTetherConnectionChanged(upstreamIface);
|
||||||
new InterfaceSet(upstreamIface));
|
mIpServer.sendMessage(IpServer.CMD_IPV6_TETHER_UPDATE, v6lp);
|
||||||
if (v6lp != null) {
|
|
||||||
mIpServer.sendMessage(IpServer.CMD_IPV6_TETHER_UPDATE, v6lp);
|
|
||||||
}
|
|
||||||
mLooper.dispatchAll();
|
mLooper.dispatchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dispatchTetherConnectionChanged(String upstreamIface) {
|
private void dispatchTetherConnectionChanged(String upstreamIface) {
|
||||||
dispatchTetherConnectionChanged(upstreamIface, null);
|
final InterfaceSet ifs = (upstreamIface != null) ? new InterfaceSet(upstreamIface) : null;
|
||||||
|
mIpServer.sendMessage(IpServer.CMD_TETHER_CONNECTION_CHANGED, ifs);
|
||||||
|
mLooper.dispatchAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertIPv4AddressAndDirectlyConnectedRoute(LinkProperties lp) {
|
private void assertIPv4AddressAndDirectlyConnectedRoute(LinkProperties lp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user