use of android.net.ConnectivityMetricsEvent.Reference in project android_frameworks_base by ResurrectionRemix.
the class MetricsLoggerServiceTest method testMultipleGetAll.
public void testMultipleGetAll() throws Exception {
mService.mBinder.logEvents(Arrays.copyOf(EVENTS, 3));
Reference r1 = new Reference(0);
assertArrayEquals(Arrays.copyOf(EVENTS, 3), mService.mBinder.getEvents(r1));
assertEquals(3, r1.getValue());
mService.mBinder.logEvents(Arrays.copyOfRange(EVENTS, 3, 10));
Reference r2 = new Reference(0);
assertArrayEquals(EVENTS, mService.mBinder.getEvents(r2));
assertEquals(N_EVENTS, r2.getValue());
}
use of android.net.ConnectivityMetricsEvent.Reference 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.Reference in project android_frameworks_base by ResurrectionRemix.
the class MetricsLoggerServiceTest method testGetNoEvents.
public void testGetNoEvents() throws Exception {
Reference r = new Reference(0);
assertArrayEquals(NO_EVENTS, mService.mBinder.getEvents(r));
assertEquals(0, r.getValue());
}
use of android.net.ConnectivityMetricsEvent.Reference in project android_frameworks_base by ResurrectionRemix.
the class MetricsLoggerServiceTest method testInterleavedLogAndGet.
public void testInterleavedLogAndGet() throws Exception {
mService.mBinder.logEvents(Arrays.copyOfRange(EVENTS, 0, 3));
Reference r = new Reference(0);
assertArrayEquals(Arrays.copyOfRange(EVENTS, 0, 3), mService.mBinder.getEvents(r));
assertEquals(3, r.getValue());
mService.mBinder.logEvents(Arrays.copyOfRange(EVENTS, 3, 8));
mService.mBinder.logEvents(Arrays.copyOfRange(EVENTS, 8, 10));
assertArrayEquals(Arrays.copyOfRange(EVENTS, 3, 10), 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.Reference in project android_frameworks_base by DirtyUnicorns.
the class MetricsLoggerServiceTest method testMultipleGetAll.
public void testMultipleGetAll() throws Exception {
mService.mBinder.logEvents(Arrays.copyOf(EVENTS, 3));
Reference r1 = new Reference(0);
assertArrayEquals(Arrays.copyOf(EVENTS, 3), mService.mBinder.getEvents(r1));
assertEquals(3, r1.getValue());
mService.mBinder.logEvents(Arrays.copyOfRange(EVENTS, 3, 10));
Reference r2 = new Reference(0);
assertArrayEquals(EVENTS, mService.mBinder.getEvents(r2));
assertEquals(N_EVENTS, r2.getValue());
}
Aggregations