Merge "Fix error message in RestrictBackgroundNetworkTest" am: e80f1b5e31

Change-Id: Id0b14b96632b497d874b9d59a21ddabfcb803c25
This commit is contained in:
Sudheer Shanka
2020-05-01 01:09:32 +00:00
committed by Automerger Merge Worker

View File

@@ -30,6 +30,7 @@ import static com.android.cts.net.hostside.NetworkPolicyTestUtils.isDozeModeSupp
import static com.android.cts.net.hostside.NetworkPolicyTestUtils.restrictBackgroundValueToString; import static com.android.cts.net.hostside.NetworkPolicyTestUtils.restrictBackgroundValueToString;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
@@ -188,7 +189,9 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
do { do {
attempts++; attempts++;
count = getNumberBroadcastsReceived(receiverName, ACTION_RESTRICT_BACKGROUND_CHANGED); count = getNumberBroadcastsReceived(receiverName, ACTION_RESTRICT_BACKGROUND_CHANGED);
if (count >= expectedCount) { assertFalse("Expected count " + expectedCount + " but actual is " + count,
count > expectedCount);
if (count == expectedCount) {
break; break;
} }
Log.d(TAG, "Expecting count " + expectedCount + " but actual is " + count + " after " Log.d(TAG, "Expecting count " + expectedCount + " but actual is " + count + " after "