diff options
author | Andrew Lee <anwlee@google.com> | 2015-10-05 13:43:54 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-10-07 15:20:49 -0700 |
commit | bf9cca2ee005acd384ae25b80c3945a5fd1d5f20 (patch) | |
tree | a4680b72683245da6b9098f7cbcb4bba74590b55 /tests/src/com/android | |
parent | 34f5df7389ab7966ab974147ddcd6891598b6e43 (diff) |
Add footer actions to Call Details.
Some of these are moved down from the overflow. Others are added
from the list of those shown after a call log list item long press.
This hooks up the block/unblock functionality, although there is
still polish (eg. icons) and cleanup (some noted as TODOs), to
complete still.
Bug: 24109819
Change-Id: I129f5b09ac1c5edb66ab5bd91a46b18961240fb5
Diffstat (limited to 'tests/src/com/android')
-rw-r--r-- | tests/src/com/android/dialer/CallDetailActivityTest.java | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/src/com/android/dialer/CallDetailActivityTest.java b/tests/src/com/android/dialer/CallDetailActivityTest.java index eda74742b..c310c8870 100644 --- a/tests/src/com/android/dialer/CallDetailActivityTest.java +++ b/tests/src/com/android/dialer/CallDetailActivityTest.java @@ -16,7 +16,7 @@ package com.android.dialer; -import static com.android.dialer.calllog.CallLogAsyncTaskUtil.Tasks.GET_CALL_DETAILS; +import static com.android.dialer.calllog.CallLogAsyncTaskUtil.Tasks; import android.content.ContentResolver; import android.content.ContentUris; @@ -89,14 +89,20 @@ public class CallDetailActivityTest extends ActivityInstrumentationTestCase2<Cal public void testVoicemailDeleteButton() throws Throwable { setActivityIntentForTestVoicemailEntry(); startActivityUnderTest(); - mFakeAsyncTaskExecutor.runTask(GET_CALL_DETAILS); + mFakeAsyncTaskExecutor.runTask(Tasks.GET_CALL_DETAILS); Menu optionsMenu = (new PopupMenu(mActivityUnderTest, null)).getMenu(); mActivityUnderTest.onCreateOptionsMenu(optionsMenu); mActivityUnderTest.onPrepareOptionsMenu(optionsMenu); - assertTrue(optionsMenu.findItem(R.id.call_detail_delete_menu_item).isVisible()); assertTrue(mActivityUnderTest.hasVoicemail()); + mActivityUnderTest.runOnUiThread(new Runnable() { + public void run() { + mActivityUnderTest.findViewById(R.id.call_detail_delete_menu_item).performClick(); + } + }); + getInstrumentation().waitForIdleSync(); + mFakeAsyncTaskExecutor.runTask(Tasks.DELETE_VOICEMAIL); } /** @@ -105,14 +111,20 @@ public class CallDetailActivityTest extends ActivityInstrumentationTestCase2<Cal public void testRegularCallDoesHaveRemoveFromCallLog() throws Throwable { setActivityIntentForTestCallEntry(); startActivityUnderTest(); - mFakeAsyncTaskExecutor.runTask(GET_CALL_DETAILS); + mFakeAsyncTaskExecutor.runTask(Tasks.GET_CALL_DETAILS); Menu optionsMenu = (new PopupMenu(mActivityUnderTest, null)).getMenu(); mActivityUnderTest.onCreateOptionsMenu(optionsMenu); mActivityUnderTest.onPrepareOptionsMenu(optionsMenu); - assertTrue(optionsMenu.findItem(R.id.call_detail_delete_menu_item).isVisible()); assertFalse(mActivityUnderTest.hasVoicemail()); + mActivityUnderTest.runOnUiThread(new Runnable() { + public void run() { + mActivityUnderTest.findViewById(R.id.call_detail_delete_menu_item).performClick(); + } + }); + getInstrumentation().waitForIdleSync(); + mFakeAsyncTaskExecutor.runTask(Tasks.DELETE_CALL); } private void setActivityIntentForTestCallEntry() { |