use of org.odk.collect.androidshared.system.IntentLauncher in project collect by opendatakit.
the class ExImageWidgetTest method setup.
@Before
public void setup() {
mediaUtils = mock(MediaUtils.class);
CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public MediaUtils providesMediaUtils(IntentLauncher intentLauncher) {
return mediaUtils;
}
});
when(mediaUtils.isImageFile(any())).thenReturn(true);
}
use of org.odk.collect.androidshared.system.IntentLauncher in project collect by opendatakit.
the class VideoWidgetTest method buttonsShouldLaunchCorrectIntents.
@Test
public void buttonsShouldLaunchCorrectIntents() {
MediaUtils mediaUtils = mock(MediaUtils.class);
CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public MediaUtils providesMediaUtils(IntentLauncher intentLauncher) {
return mediaUtils;
}
});
stubAllRuntimePermissionsGranted(true);
Intent intent = getIntentLaunchedByClick(R.id.capture_video);
assertActionEquals(MediaStore.ACTION_VIDEO_CAPTURE, intent);
intent = getIntentLaunchedByClick(R.id.choose_video);
assertActionEquals(Intent.ACTION_GET_CONTENT, intent);
assertTypeEquals("video/*", intent);
getIntentLaunchedByClick(R.id.play_video);
verify(mediaUtils).openFile(any(), any(), any());
}
use of org.odk.collect.androidshared.system.IntentLauncher in project collect by opendatakit.
the class ArbitraryFileWidgetTest method setup.
@Before
public void setup() {
mediaUtils = mock(MediaUtils.class);
CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public MediaUtils providesMediaUtils(IntentLauncher intentLauncher) {
return mediaUtils;
}
});
when(mediaUtils.isAudioFile(any())).thenReturn(true);
}
use of org.odk.collect.androidshared.system.IntentLauncher in project collect by opendatakit.
the class ExVideoWidgetTest method setup.
@Before
public void setup() {
mediaUtils = mock(MediaUtils.class);
CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public MediaUtils providesMediaUtils(IntentLauncher intentLauncher) {
return mediaUtils;
}
});
when(mediaUtils.isVideoFile(any())).thenReturn(true);
}
use of org.odk.collect.androidshared.system.IntentLauncher in project collect by opendatakit.
the class ExAudioWidgetTest method setup.
@Before
public void setup() {
mediaUtils = mock(MediaUtils.class);
CollectHelpers.overrideAppDependencyModule(new AppDependencyModule() {
@Override
public MediaUtils providesMediaUtils(IntentLauncher intentLauncher) {
return mediaUtils;
}
});
when(mediaUtils.isAudioFile(any())).thenReturn(true);
}
Aggregations