diff options
author | Andrew Lee <anwlee@google.com> | 2015-09-02 17:35:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-02 17:35:59 +0000 |
commit | 1e864d0c64e0fe64c471bee1fb82525356aeb9db (patch) | |
tree | ba91326cf6ee72d2285859c6f472e0a791c90cec /tests/src/com | |
parent | a7a74c95e8f9bc874d98b358ac060009b092b315 (diff) | |
parent | 393b68131d1439b2e0cb7d55cf3b897aa0f46def (diff) |
Merge "Fix CallDetailActivityTest." into ub-contactsdialer-a-dev
Diffstat (limited to 'tests/src/com')
-rw-r--r-- | tests/src/com/android/dialer/CallDetailActivityTest.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/src/com/android/dialer/CallDetailActivityTest.java b/tests/src/com/android/dialer/CallDetailActivityTest.java index c87424482..59c2434f2 100644 --- a/tests/src/com/android/dialer/CallDetailActivityTest.java +++ b/tests/src/com/android/dialer/CallDetailActivityTest.java @@ -29,12 +29,12 @@ import android.test.ActivityInstrumentationTestCase2; import android.test.suitebuilder.annotation.LargeTest; import android.test.suitebuilder.annotation.Suppress; import android.view.Menu; +import android.widget.PopupMenu; import android.widget.TextView; import com.android.dialer.calllog.CallLogAsyncTaskUtil; import com.android.dialer.util.AsyncTaskExecutors; import com.android.dialer.util.FakeAsyncTaskExecutor; -// import com.android.internal.view.menu.ContextMenuBuilder; /** * Unit tests for the {@link CallDetailActivity}. NOTE: The screen needs to be on for the @@ -86,33 +86,33 @@ public class CallDetailActivityTest extends ActivityInstrumentationTestCase2<Cal * Test for bug where voicemails should not have remove-from-call-log entry. * <p> * See http://b/5054103. + */ public void testVoicemailDoesNotHaveRemoveFromCallLog() throws Throwable { setActivityIntentForTestVoicemailEntry(); startActivityUnderTest(); mFakeAsyncTaskExecutor.runTask(GET_CALL_DETAILS); - Menu menu = new ContextMenuBuilder(mActivityUnderTest); - mActivityUnderTest.onCreateOptionsMenu(menu); - mActivityUnderTest.onPrepareOptionsMenu(menu); - assertFalse(menu.findItem(R.id.menu_remove_from_call_log).isVisible()); - assertTrue(menu.findItem(R.id.menu_trash).isVisible()); + Menu optionsMenu = (new PopupMenu(mActivityUnderTest, null)).getMenu(); + mActivityUnderTest.onCreateOptionsMenu(optionsMenu); + mActivityUnderTest.onPrepareOptionsMenu(optionsMenu); + assertFalse(optionsMenu.findItem(R.id.menu_remove_from_call_log).isVisible()); + assertTrue(optionsMenu.findItem(R.id.menu_trash).isVisible()); } - */ /** * Test to check that I haven't broken the remove-from-call-log entry from regular calls. + */ public void testRegularCallDoesHaveRemoveFromCallLog() throws Throwable { setActivityIntentForTestCallEntry(); startActivityUnderTest(); mFakeAsyncTaskExecutor.runTask(GET_CALL_DETAILS); - Menu menu = new ContextMenuBuilder(mActivityUnderTest); - mActivityUnderTest.onCreateOptionsMenu(menu); - mActivityUnderTest.onPrepareOptionsMenu(menu); - assertTrue(menu.findItem(R.id.menu_remove_from_call_log).isVisible()); - assertFalse(menu.findItem(R.id.menu_trash).isVisible()); + Menu optionsMenu = (new PopupMenu(mActivityUnderTest, null)).getMenu(); + mActivityUnderTest.onCreateOptionsMenu(optionsMenu); + mActivityUnderTest.onPrepareOptionsMenu(optionsMenu); + assertTrue(optionsMenu.findItem(R.id.menu_remove_from_call_log).isVisible()); + assertFalse(optionsMenu.findItem(R.id.menu_trash).isVisible()); } - */ private void setActivityIntentForTestCallEntry() { assertNull(mVoicemailUri); |