Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc7f4f0e authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Log exception when creating Activity in ActivityUnitTestCase.

If the creation of an Activity fails, it is impossible to determine what
went wrong. We should log the exception immediately before failing on assert.

Change-Id: Ie6cbe87ff342b8d60989f5e1a6ffa3efc058c585
parent 35eb8909
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ import android.os.Bundle;
import android.os.IBinder;
import android.test.mock.MockApplication;
import android.view.Window;
import android.util.Log;



/**
 * This class provides isolated testing of a single activity.  The activity under test will
@@ -73,6 +76,7 @@ import android.view.Window;
public abstract class ActivityUnitTestCase<T extends Activity> 
        extends ActivityTestCase {

    private static final String TAG = "ActivityUnitTestCase";
    private Class<T> mActivityClass;

    private Context mActivityContext;
@@ -144,6 +148,7 @@ public abstract class ActivityUnitTestCase<T extends Activity>
                        token, mApplication, intent, info, title, mMockParent, id,
                        lastNonConfigurationInstance);
            } catch (Exception e) {
                Log.w(TAG, "Catching exception", e);
                assertNotNull(newActivity);
            }