public void testFailedUnregistration() throws InterruptedException { final FakeGcmProvider gcm = new FakeGcmProvider(null, true, true); final GcmUnregistrationApiRequestImpl registrar = new GcmUnregistrationApiRequestImpl(getContext(), gcm); final GcmUnregistrationListener listener = getGcmUnregistrationListener(false); registrar.startUnregistration(listener); semaphore.acquire(); assertTrue(gcm.wasUnregisterCalled()); }
public void testSuccessfulInitialUnregistration() throws InterruptedException { final FakeGcmProvider gcm = new FakeGcmProvider(TEST_GCM_DEVICE_REGISTRATION_ID, true, false); final GcmUnregistrationApiRequestImpl request = new GcmUnregistrationApiRequestImpl(getContext(), gcm); final GcmUnregistrationListener listener = getGcmUnregistrationListener(true); request.startUnregistration(listener); semaphore.acquire(); assertTrue(gcm.wasUnregisterCalled()); }