Merge "Not to use any() to verify DataStallDetectionStats"
This commit is contained in:
@@ -525,7 +525,7 @@ public class NetworkMonitorTest {
|
|||||||
wrappedMonitor.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
|
wrappedMonitor.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
|
||||||
makeDnsTimeoutEvent(wrappedMonitor, 5);
|
makeDnsTimeoutEvent(wrappedMonitor, 5);
|
||||||
assertTrue(wrappedMonitor.isDataStall());
|
assertTrue(wrappedMonitor.isDataStall());
|
||||||
verify(mDataStallStatsUtils, times(1)).write(any(), any());
|
verify(mDataStallStatsUtils, times(1)).write(makeEmptyDataStallDetectionStats(), any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -534,7 +534,7 @@ public class NetworkMonitorTest {
|
|||||||
wrappedMonitor.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
|
wrappedMonitor.setLastProbeTime(SystemClock.elapsedRealtime() - 1000);
|
||||||
makeDnsTimeoutEvent(wrappedMonitor, 3);
|
makeDnsTimeoutEvent(wrappedMonitor, 3);
|
||||||
assertFalse(wrappedMonitor.isDataStall());
|
assertFalse(wrappedMonitor.isDataStall());
|
||||||
verify(mDataStallStatsUtils, never()).write(any(), any());
|
verify(mDataStallStatsUtils, never()).write(makeEmptyDataStallDetectionStats(), any());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -586,6 +586,10 @@ public class NetworkMonitorTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DataStallDetectionStats makeEmptyDataStallDetectionStats() {
|
||||||
|
return new DataStallDetectionStats.Builder().build();
|
||||||
|
}
|
||||||
|
|
||||||
private void setDataStallEvaluationType(int type) {
|
private void setDataStallEvaluationType(int type) {
|
||||||
when(mDependencies.getSetting(any(),
|
when(mDependencies.getSetting(any(),
|
||||||
eq(Settings.Global.DATA_STALL_EVALUATION_TYPE), anyInt())).thenReturn(type);
|
eq(Settings.Global.DATA_STALL_EVALUATION_TYPE), anyInt())).thenReturn(type);
|
||||||
|
|||||||
Reference in New Issue
Block a user