Adapt tests to do-not-kill lib as well

This commit is contained in:
Torsten Grote
2022-04-20 13:05:50 -03:00
parent 1b58d986ae
commit 37d4ca84f7
3 changed files with 4 additions and 3 deletions

View File

@@ -39,11 +39,11 @@ import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static java.lang.Thread.sleep;
import static org.briarproject.android.dontkillmelib.DozeUtils.needsDozeWhitelisting;
import static org.briarproject.bramble.api.plugin.LanTcpConstants.ID;
import static org.briarproject.briar.android.OverlayTapViewAction.visualClick;
import static org.briarproject.briar.android.ViewActions.waitFor;
import static org.briarproject.briar.android.ViewActions.waitUntilMatches;
import static org.briarproject.briar.android.util.UiUtils.needsDozeWhitelisting;
import static org.hamcrest.CoreMatchers.allOf;
import static org.junit.Assert.assertTrue;

View File

@@ -26,9 +26,9 @@ import static androidx.test.espresso.matcher.ViewMatchers.isEnabled;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static org.briarproject.android.dontkillmelib.DozeUtils.needsDozeWhitelisting;
import static org.briarproject.bramble.api.plugin.LanTcpConstants.ID;
import static org.briarproject.briar.android.ViewActions.waitUntilMatches;
import static org.briarproject.briar.android.util.UiUtils.needsDozeWhitelisting;
import static org.hamcrest.Matchers.allOf;
import static org.junit.Assert.assertTrue;

View File

@@ -3,6 +3,7 @@ package org.briarproject.briar.android.account;
import android.app.Application;
import android.content.Context;
import org.briarproject.android.dontkillmelib.DozeHelper;
import org.briarproject.bramble.api.account.AccountManager;
import org.briarproject.bramble.api.crypto.PasswordStrengthEstimator;
import org.briarproject.bramble.test.BrambleMockTestCase;
@@ -48,7 +49,7 @@ public class SetupViewModelTest extends BrambleMockTestCase {
context.checking(new Expectations() {{
oneOf(accountManager).accountExists();
will(returnValue(false));
allowing(dozeHelper).needToShowDozeFragment(app);
allowing(dozeHelper).needToShowDoNotKillMeFragment(app);
allowing(app).getApplicationContext();
will(returnValue(appContext));
allowing(appContext).getPackageManager();