First prototype of Espresso test infrastructure with automatic screenshoting

This commit is contained in:
Torsten Grote
2018-07-24 14:04:23 -03:00
parent db11e0101a
commit d0c2c03057
13 changed files with 435 additions and 4 deletions

View File

@@ -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

View File

@@ -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();