diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-19 23:07:18 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-19 23:07:18 +0000 |
commit | 701991bd5ec2845746968ded38f79cd98eda7c0e (patch) | |
tree | 6031357794578b5a6bbb16d8ed5197e9f73dfd9a | |
parent | 5343f1142e90a2a2189adaa82b96d3058738c665 (diff) | |
parent | 64b87d2d58aafd3c206a3ff3b147670e93a324a9 (diff) | |
download | ethernet-701991bd5ec2845746968ded38f79cd98eda7c0e.tar.gz |
Snap for 8326520 from 64b87d2d58aafd3c206a3ff3b147670e93a324a9 to tm-release
Change-Id: Idf1e641c7682f65ffcee54bfb144b0dd06ab14a5
-rw-r--r-- | tests/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java b/tests/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java index 5d23aaf..2d5bd1d 100644 --- a/tests/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java +++ b/tests/java/com/android/server/ethernet/EthernetNetworkFactoryTest.java @@ -279,19 +279,13 @@ public class EthernetNetworkFactoryTest { // creates an unprovisioned interface private void createUnprovisionedInterface(String iface) throws Exception { - // the only way to create an unprovisioned interface is by calling needNetworkFor - // followed by releaseNetworkFor which will stop the NetworkAgent and IpClient. When - // EthernetNetworkFactory#updateInterfaceLinkState(iface, true) is called, the interface - // is automatically provisioned even if nobody has ever called needNetworkFor + // To create an unprovisioned interface, provision and then "stop" it, i.e. stop its + // NetworkAgent and IpClient. One way this can be done is by provisioning an interface and + // then calling onNetworkUnwanted. createAndVerifyProvisionedInterface(iface); - // Interface is already provisioned, so startProvisioning / register should not be called - // again - mNetFactory.needNetworkFor(createDefaultRequest()); - verify(mIpClient, never()).startProvisioning(any()); - verify(mNetworkAgent, never()).register(); - - mNetFactory.releaseNetworkFor(createDefaultRequest()); + mNetworkAgent.getCallbacks().onNetworkUnwanted(); + mLooper.dispatchAll(); verifyStop(); clearInvocations(mIpClient); |