fixed teardown

This commit is contained in:
Antonio Zugaldia
2015-09-15 17:28:43 -04:00
parent d9376a3c0f
commit ed161e020a

View File

@@ -37,23 +37,22 @@ public class BaseTest
@Override
protected void tearDown() throws Exception {
if (!screenshotOnTearDown) {
return;
}
try {
// Screenshots should be taken on the UI thread
runTestOnUiThread(new Runnable() {
@Override
public void run() {
ScreenshotUtil.take(getActivity(), null);
}
});
} catch (Throwable throwable) {
throwable.printStackTrace();
if (screenshotOnTearDown) {
try {
// Screenshots should be taken on the UI thread
runTestOnUiThread(new Runnable() {
@Override
public void run() {
ScreenshotUtil.take(getActivity(), null);
}
});
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
super.tearDown();
mActivity = null;
}
protected void takeNamedScreenshot(final String name) {