mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 14:19:53 +01:00
Catch UnableToTakeScreenshotException to make CI more stable
This commit is contained in:
@@ -3,6 +3,8 @@ package org.briarproject.briar.android;
|
|||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.jraska.falcon.Falcon.UnableToTakeScreenshotException;
|
||||||
|
|
||||||
import org.briarproject.bramble.api.connection.ConnectionRegistry;
|
import org.briarproject.bramble.api.connection.ConnectionRegistry;
|
||||||
import org.briarproject.bramble.api.system.Clock;
|
import org.briarproject.bramble.api.system.Clock;
|
||||||
import org.briarproject.briar.api.test.TestDataCreator;
|
import org.briarproject.briar.api.test.TestDataCreator;
|
||||||
@@ -34,6 +36,8 @@ public abstract class ScreenshotTest extends UiTest {
|
|||||||
protected void screenshot(String name, Activity activity) {
|
protected void screenshot(String name, Activity activity) {
|
||||||
try {
|
try {
|
||||||
Screengrab.screenshot(name, new FalconScreenshotStrategy(activity));
|
Screengrab.screenshot(name, new FalconScreenshotStrategy(activity));
|
||||||
|
} catch (UnableToTakeScreenshotException e) {
|
||||||
|
Log.e("Screengrab", "Error taking screenshot", e);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
if (e.getMessage() == null ||
|
if (e.getMessage() == null ||
|
||||||
!e.getMessage().equals("Unable to capture screenshot."))
|
!e.getMessage().equals("Unable to capture screenshot."))
|
||||||
|
|||||||
Reference in New Issue
Block a user