diff options
author | Filip Gruszczynski <gruszczy@google.com> | 2014-10-10 04:26:18 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-10-10 04:26:18 +0000 |
commit | 1e788daf6a0a4c3ad561002e1039f9cc2450d578 (patch) | |
tree | b851d9333c76ca3aa5d7647f7174a7011b7ff592 /test-runner | |
parent | 3ad81eee7202317220599454bf550a755516a449 (diff) | |
parent | 6c99561384dafaa080b804078e55c6167efe0e11 (diff) | |
download | frameworks_base-1e788daf6a0a4c3ad561002e1039f9cc2450d578.zip frameworks_base-1e788daf6a0a4c3ad561002e1039f9cc2450d578.tar.gz frameworks_base-1e788daf6a0a4c3ad561002e1039f9cc2450d578.tar.bz2 |
am 6c995613: am 301d2276: am 49e2371a: Merge "Log exception when creating Activity in ActivityUnitTestCase." into lmp-sprout-dev
* commit '6c99561384dafaa080b804078e55c6167efe0e11':
Log exception when creating Activity in ActivityUnitTestCase.
Diffstat (limited to 'test-runner')
-rw-r--r-- | test-runner/src/android/test/ActivityUnitTestCase.java | 13 |
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); |