use of android.net.ConnectivityMetricsEvent in project platform_frameworks_base by android.
the class IpConnectivityEventBuilderTest method testValidationProbeEventSerialization.
public void testValidationProbeEventSerialization() {
ConnectivityMetricsEvent ev = describeIpEvent(aType(ValidationProbeEvent.class), anInt(120), aLong(40730), anInt(ValidationProbeEvent.PROBE_HTTP), anInt(204));
String want = joinLines("dropped_events: 0", "events <", " time_ms: 1", " validation_probe_event <", " latency_ms: 40730", " network_id <", " network_id: 120", " >", " probe_result: 204", " probe_type: 1", " >", ">", "version: 2");
verifySerialization(want, ev);
}
use of android.net.ConnectivityMetricsEvent in project platform_frameworks_base by android.
the class IpConnectivityMetricsTest method testLoggingEvents.
public void testLoggingEvents() throws Exception {
IpConnectivityLog logger = new IpConnectivityLog(mMockService);
assertTrue(logger.log(1, FAKE_EV));
assertTrue(logger.log(2, FAKE_EV));
assertTrue(logger.log(3, FAKE_EV));
List<ConnectivityMetricsEvent> got = verifyEvents(3);
assertEventsEqual(expectedEvent(1), got.get(0));
assertEventsEqual(expectedEvent(2), got.get(1));
assertEventsEqual(expectedEvent(3), got.get(2));
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class IpConnectivityMetricsTest method testLoggingEvents.
@SmallTest
public void testLoggingEvents() throws Exception {
IpConnectivityLog logger = new IpConnectivityLog(mMockService);
assertTrue(logger.log(1, FAKE_EV));
assertTrue(logger.log(2, FAKE_EV));
assertTrue(logger.log(3, FAKE_EV));
List<ConnectivityMetricsEvent> got = verifyEvents(3);
assertEventsEqual(expectedEvent(1), got.get(0));
assertEventsEqual(expectedEvent(2), got.get(1));
assertEventsEqual(expectedEvent(3), got.get(2));
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class MetricsLoggerServiceTest method testLogOneByOne.
public void testLogOneByOne() throws Exception {
for (ConnectivityMetricsEvent ev : EVENTS) {
mService.mBinder.logEvent(ev);
}
Reference r = new Reference(0);
assertArrayEquals(EVENTS, mService.mBinder.getEvents(r));
assertEquals(N_EVENTS, r.getValue());
assertArrayEquals(NO_EVENTS, mService.mBinder.getEvents(r));
assertEquals(N_EVENTS, r.getValue());
}
use of android.net.ConnectivityMetricsEvent in project android_frameworks_base by ResurrectionRemix.
the class IpConnectivityEventBuilderTest method testRaEventSerialization.
@SmallTest
public void testRaEventSerialization() {
ConnectivityMetricsEvent ev = describeIpEvent(aType(RaEvent.class), aLong(2000), aLong(400), aLong(300), aLong(-1), aLong(1000), aLong(-1));
String want = joinLines("dropped_events: 0", "events <", " time_ms: 1", " transport: 0", " ra_event <", " dnssl_lifetime: -1", " prefix_preferred_lifetime: 300", " prefix_valid_lifetime: 400", " rdnss_lifetime: 1000", " route_info_lifetime: -1", " router_lifetime: 2000", " >", ">", "version: 2");
verifySerialization(want, ev);
}
Aggregations