Merge "Temporarily disable NetworkInfo check." into nyc-dev
am: cdb30f18e4 * commit 'cdb30f18e44f14b32cfe76c572af22f82a816a00': Temporarily disable NetworkInfo check. Change-Id: I2092f714c8db0b024e1ee9d5ba35e7a9a4023747
This commit is contained in:
@@ -71,6 +71,8 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
|
|||||||
// Must be higher than NETWORK_TIMEOUT_MS
|
// Must be higher than NETWORK_TIMEOUT_MS
|
||||||
private static final int ORDERED_BROADCAST_TIMEOUT_MS = NETWORK_TIMEOUT_MS * 4;
|
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 Context mContext;
|
||||||
protected Instrumentation mInstrumentation;
|
protected Instrumentation mInstrumentation;
|
||||||
protected ConnectivityManager mCm;
|
protected ConnectivityManager mCm;
|
||||||
@@ -220,15 +222,19 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
|
|||||||
if (expectAvailable) {
|
if (expectAvailable) {
|
||||||
assertTrue("should be connected: " + connectionCheckDetails
|
assertTrue("should be connected: " + connectionCheckDetails
|
||||||
+ " (network info: " + networkInfo + ")", connected);
|
+ " (network info: " + networkInfo + ")", connected);
|
||||||
assertEquals("wrong state for " + networkInfo, State.CONNECTED, state);
|
if (ASSERT_NETWORK_INFO_STATE) {
|
||||||
assertEquals("wrong detailed state for " + networkInfo,
|
assertEquals("wrong state for " + networkInfo, State.CONNECTED, state);
|
||||||
DetailedState.CONNECTED, detailedState);
|
assertEquals("wrong detailed state for " + networkInfo,
|
||||||
|
DetailedState.CONNECTED, detailedState);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
assertFalse("should not be connected: " + connectionCheckDetails
|
assertFalse("should not be connected: " + connectionCheckDetails
|
||||||
+ " (network info: " + networkInfo + ")", connected);
|
+ " (network info: " + networkInfo + ")", connected);
|
||||||
assertEquals("wrong state for " + networkInfo, State.DISCONNECTED, state);
|
if (ASSERT_NETWORK_INFO_STATE) {
|
||||||
assertEquals("wrong detailed state for " + networkInfo,
|
assertEquals("wrong state for " + networkInfo, State.DISCONNECTED, state);
|
||||||
DetailedState.BLOCKED, detailedState);
|
assertEquals("wrong detailed state for " + networkInfo,
|
||||||
|
DetailedState.BLOCKED, detailedState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user