use of com.waz.zclient.controllers.accentcolor.IAccentColorController in project wire-android by wireapp.
the class ConversationFragmentTest method assertCursorImagesGalleryButton.
@TargetApi(Build.VERSION_CODES.KITKAT)
public void assertCursorImagesGalleryButton() throws Exception {
IConversation mockConversation = mock(IConversation.class);
when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
when(mockConversation.isMemberOfConversation()).thenReturn(true);
when(mockConversation.isActive()).thenReturn(true);
IAccentColorController mockAccentColorController = activity.getControllerFactory().getAccentColorController();
AccentColor mockAccentColor = mock(AccentColor.class);
when(mockAccentColor.getColor()).thenReturn(Color.RED);
when(mockAccentColorController.getAccentColor()).thenReturn(mockAccentColor);
String action = Intent.ACTION_OPEN_DOCUMENT;
Matcher<Intent> expectedIntent = allOf(hasAction(action), hasType("image/*"));
Intent intent = new Intent();
intent.setData(Uri.parse("file:///tmp/whatever.txt"));
Instrumentation.ActivityResult result = new Instrumentation.ActivityResult(Activity.RESULT_OK, intent);
intending(expectedIntent).respondWith(result);
MockHelper.setupConversationMocks(mockConversation, activity);
attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
onView(withId(R.id.cursor_menu_item_camera)).check(isVisible());
onView(withId(R.id.cursor_menu_item_camera)).perform(click());
Thread.sleep(500);
onView(withId(R.id.rv__cursor_images)).check(isVisible());
onView(withId(R.id.gtv__cursor_image__nav_open_gallery)).check(isVisible());
// onView(withId(R.id.gtv__cursor_image__nav_open_gallery)).perform(click());
}
Aggregations