mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
First prototype of Espresso test infrastructure with automatic screenshoting
This commit is contained in:
@@ -109,15 +109,20 @@ public class BriarApplicationImpl extends Application
|
||||
|
||||
LOG.info("Created");
|
||||
|
||||
applicationComponent = DaggerAndroidComponent.builder()
|
||||
applicationComponent = createApplicationComponent();
|
||||
}
|
||||
|
||||
protected AndroidComponent createApplicationComponent() {
|
||||
AndroidComponent androidComponent = DaggerAndroidComponent.builder()
|
||||
.appModule(new AppModule(this))
|
||||
.build();
|
||||
|
||||
// We need to load the eager singletons directly after making the
|
||||
// dependency graphs
|
||||
BrambleCoreModule.initEagerSingletons(applicationComponent);
|
||||
BriarCoreModule.initEagerSingletons(applicationComponent);
|
||||
AndroidEagerSingletons.initEagerSingletons(applicationComponent);
|
||||
BrambleCoreModule.initEagerSingletons(androidComponent);
|
||||
BriarCoreModule.initEagerSingletons(androidComponent);
|
||||
AndroidEagerSingletons.initEagerSingletons(androidComponent);
|
||||
return androidComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,6 +55,7 @@ import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
|
||||
import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
|
||||
import static android.text.format.DateUtils.WEEK_IN_MILLIS;
|
||||
import static org.briarproject.briar.BuildConfig.APPLICATION_ID;
|
||||
import static org.briarproject.briar.BuildConfig.BUILD_TYPE;
|
||||
import static org.briarproject.briar.android.TestingConstants.EXPIRY_DATE;
|
||||
|
||||
@MethodsNotNullByDefault
|
||||
@@ -174,6 +175,7 @@ public class UiUtils {
|
||||
|
||||
public static boolean needsDozeWhitelisting(Context ctx) {
|
||||
if (SDK_INT < 23) return false;
|
||||
if (BUILD_TYPE.equals("screenshot")) return false;
|
||||
PowerManager pm = (PowerManager) ctx.getSystemService(POWER_SERVICE);
|
||||
String packageName = ctx.getPackageName();
|
||||
if (pm == null) throw new AssertionError();
|
||||
|
||||
Reference in New Issue
Block a user