Search in sources :

Example 6 with MediaUtils

use of org.odk.collect.android.utilities.MediaUtils 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);
}
Also used : IntentLauncher(org.odk.collect.androidshared.system.IntentLauncher) MediaUtils(org.odk.collect.android.utilities.MediaUtils) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) Before(org.junit.Before)

Example 7 with MediaUtils

use of org.odk.collect.android.utilities.MediaUtils 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);
}
Also used : IntentLauncher(org.odk.collect.androidshared.system.IntentLauncher) MediaUtils(org.odk.collect.android.utilities.MediaUtils) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) Before(org.junit.Before)

Example 8 with MediaUtils

use of org.odk.collect.android.utilities.MediaUtils in project collect by opendatakit.

the class ExArbitraryFileWidgetTest 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);
}
Also used : IntentLauncher(org.odk.collect.androidshared.system.IntentLauncher) MediaUtils(org.odk.collect.android.utilities.MediaUtils) AppDependencyModule(org.odk.collect.android.injection.config.AppDependencyModule) Before(org.junit.Before)

Aggregations

MediaUtils (org.odk.collect.android.utilities.MediaUtils)8 Before (org.junit.Before)6 AppDependencyModule (org.odk.collect.android.injection.config.AppDependencyModule)6 IntentLauncher (org.odk.collect.androidshared.system.IntentLauncher)6 Test (org.junit.Test)2 Intent (android.content.Intent)1 File (java.io.File)1 Analytics (org.odk.collect.analytics.Analytics)1 AudioVideoImageTextLabel (org.odk.collect.android.formentry.questions.AudioVideoImageTextLabel)1 FormSaveViewModel (org.odk.collect.android.formentry.saving.FormSaveViewModel)1 FormController (org.odk.collect.android.javarosawrapper.FormController)1 CurrentProjectProvider (org.odk.collect.android.projects.CurrentProjectProvider)1 FileWidgetTest (org.odk.collect.android.widgets.base.FileWidgetTest)1 AudioRecorder (org.odk.collect.audiorecorder.recording.AudioRecorder)1