diff options
Diffstat (limited to 'tests/src/com/android/dialer/calllog/CallLogFragmentTest.java')
-rw-r--r-- | tests/src/com/android/dialer/calllog/CallLogFragmentTest.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java index 964d8a299..2c0fe0e23 100644 --- a/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java +++ b/tests/src/com/android/dialer/calllog/CallLogFragmentTest.java @@ -91,6 +91,11 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme private Random mRnd; + // References to the icons bitmaps used to build the list are stored in a + // map mIcons. The keys to retrieve the icons are: + // Calls.INCOMING_TYPE, Calls.OUTGOING_TYPE and Calls.MISSED_TYPE. + private HashMap<Integer, Bitmap> mCallTypeIcons; + // An item in the call list. All the methods performing checks use it. private CallLogListItemViews mItem; // The list of views representing the data in the DB. View are in @@ -128,6 +133,7 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme mAdapter.stopRequestProcessing(); mParentView = new FrameLayout(mActivity); mCursor = new MatrixCursor(CallLogQuery._PROJECTION); + buildIconMap(); } /** @@ -406,6 +412,17 @@ public class CallLogFragmentTest extends ActivityInstrumentationTestCase2<Fragme return d.getBitmap(); } + /** + * Fetch all the icons we need in tests from the contacts app and store them in a map. + */ + private void buildIconMap() { + mCallTypeIcons = new HashMap<Integer, Bitmap>(3); + + mCallTypeIcons.put(Calls.INCOMING_TYPE, getBitmap("ic_call_incoming_holo_dark")); + mCallTypeIcons.put(Calls.MISSED_TYPE, getBitmap("ic_call_missed_holo_dark")); + mCallTypeIcons.put(Calls.OUTGOING_TYPE, getBitmap("ic_call_outgoing_holo_dark")); + } + // // HELPERS to build/update the call entries (views) from the DB. // |