summaryrefslogtreecommitdiffstats
path: root/test-runner
diff options
context:
space:
mode:
authorFilip Gruszczynski <gruszczy@google.com>2014-10-08 21:12:23 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-08 21:12:25 +0000
commit49e2371a271e33bbe8177c3f87d5f3b8ef7f59c5 (patch)
treec90ccc07dc538da700c370909d57a509b4fc5867 /test-runner
parent293b883c754df6c69ec9a77820d39fb55dc60018 (diff)
parentbc7f4f0e1275fca1484c02ba465fce907c6692f7 (diff)
downloadframeworks_base-49e2371a271e33bbe8177c3f87d5f3b8ef7f59c5.zip
frameworks_base-49e2371a271e33bbe8177c3f87d5f3b8ef7f59c5.tar.gz
frameworks_base-49e2371a271e33bbe8177c3f87d5f3b8ef7f59c5.tar.bz2
Merge "Log exception when creating Activity in ActivityUnitTestCase." into lmp-sprout-dev
Diffstat (limited to 'test-runner')
-rw-r--r--test-runner/src/android/test/ActivityUnitTestCase.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/test-runner/src/android/test/ActivityUnitTestCase.java b/test-runner/src/android/test/ActivityUnitTestCase.java
index 8aa8824..40cca90 100644
--- a/test-runner/src/android/test/ActivityUnitTestCase.java
+++ b/test-runner/src/android/test/ActivityUnitTestCase.java
@@ -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;
@@ -132,27 +136,28 @@ public abstract class ActivityUnitTestCase<T extends Activity>
if (mApplication == null) {
setApplication(new MockApplication());
}
- ComponentName cn = new ComponentName(mActivityClass.getPackage().getName(),
+ ComponentName cn = new ComponentName(mActivityClass.getPackage().getName(),
mActivityClass.getName());
intent.setComponent(cn);
ActivityInfo info = new ActivityInfo();
CharSequence title = mActivityClass.getName();
mMockParent = new MockParent();
String id = null;
-
+
newActivity = (T) getInstrumentation().newActivity(mActivityClass, mActivityContext,
token, mApplication, intent, info, title, mMockParent, id,
lastNonConfigurationInstance);
} catch (Exception e) {
+ Log.w(TAG, "Catching exception", e);
assertNotNull(newActivity);
}
-
+
assertNotNull(newActivity);
setActivity(newActivity);
mAttached = true;
}
-
+
T result = getActivity();
if (result != null) {
getInstrumentation().callActivityOnCreate(getActivity(), savedInstanceState);