commit | ced6c920fede706f33877bb83cd36e456040a053 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Mar 06 21:18:51 2018 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Tue Mar 06 21:18:51 2018 +0000 |
tree | 63b1aa6fd6542a1a6c04c3ecb5d3bb1fea6fe5ad | |
parent | f7cb6d1c54ed0796440d84ce225d08017d84b1ac [diff] | |
parent | 9a7c7ee50ddd5d17f9b27c8aa8bc1de015d4c18a [diff] |
Merge "Fix timing issue for testAlwaysOnVpnPackageUninstalled test cases" into oreo-cts-dev
diff --git a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnMultiStageTest.java b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnMultiStageTest.java index 0b20c64..14f64d6 100644 --- a/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnMultiStageTest.java +++ b/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/AlwaysOnVpnMultiStageTest.java
@@ -54,6 +54,14 @@ } public void testAlwaysOnVpnDisabled() throws Exception { + // Wait until always-on vpn package is being removed (with 1 minute timeout). + for (int i = 0; i < 60; i++) { + if (mDevicePolicyManager.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT) == null) { + break; + } + Thread.sleep(1000); // 1 second. + } + // After the vpn app being uninstalled, check that always-on vpn is null assertNull(mDevicePolicyManager.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); assertFalse(VpnTestHelper.isNetworkVpn(mContext));