Merge "Temporarily disable NetworkInfo check." into nyc-dev

am: cdb30f18e4

* commit 'cdb30f18e44f14b32cfe76c572af22f82a816a00':
  Temporarily disable NetworkInfo check.

Change-Id: I2092f714c8db0b024e1ee9d5ba35e7a9a4023747
This commit is contained in:
Felipe Leme
2016-05-04 20:06:53 +00:00
committed by android-build-merger

View File

@@ -71,6 +71,8 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
// Must be higher than NETWORK_TIMEOUT_MS
private static final int ORDERED_BROADCAST_TIMEOUT_MS = NETWORK_TIMEOUT_MS * 4;
private static final boolean ASSERT_NETWORK_INFO_STATE = false;
protected Context mContext;
protected Instrumentation mInstrumentation;
protected ConnectivityManager mCm;
@@ -220,15 +222,19 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
if (expectAvailable) {
assertTrue("should be connected: " + connectionCheckDetails
+ " (network info: " + networkInfo + ")", connected);
assertEquals("wrong state for " + networkInfo, State.CONNECTED, state);
assertEquals("wrong detailed state for " + networkInfo,
DetailedState.CONNECTED, detailedState);
if (ASSERT_NETWORK_INFO_STATE) {
assertEquals("wrong state for " + networkInfo, State.CONNECTED, state);
assertEquals("wrong detailed state for " + networkInfo,
DetailedState.CONNECTED, detailedState);
}
} else {
assertFalse("should not be connected: " + connectionCheckDetails
+ " (network info: " + networkInfo + ")", connected);
assertEquals("wrong state for " + networkInfo, State.DISCONNECTED, state);
assertEquals("wrong detailed state for " + networkInfo,
DetailedState.BLOCKED, detailedState);
if (ASSERT_NETWORK_INFO_STATE) {
assertEquals("wrong state for " + networkInfo, State.DISCONNECTED, state);
assertEquals("wrong detailed state for " + networkInfo,
DetailedState.BLOCKED, detailedState);
}
}
}