Skip to content

Commit

Permalink
react to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Apr 20, 2020
1 parent b39aff7 commit ff790ff
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 96 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package constantin.video.example;


//Open and close the video activity repeatedly fast which should not
//but currently can result in crashes
// Play all the test vides for N_ITERATIONS times

import android.content.Context;
import android.content.Intent;
Expand All @@ -18,10 +16,11 @@

import constantin.video.core.DecodingInfo;
import constantin.video.core.video_player.VideoPlayer;
import constantin.video.core.video_player.VideoSettings;

public class PlayTestVideosRepeated {
private static final int WAIT_TIME_SHORT = 5*1000; //n seconds
private static final int N_ITERATIONS=10;
private static final int N_ITERATIONS=1;

@Rule
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
Expand All @@ -36,10 +35,9 @@ public class PlayTestVideosRepeated {
"android.permission.INTERNET");


private void writeVideoSource(final int videoSource){
private void writeVideoSource(final VideoSettings.VS_SOURCE videoSource){
final Context context=mActivityTestRule.getActivity();
SharedPreferences sharedPreferences=context.getSharedPreferences("pref_video",Context.MODE_PRIVATE);
sharedPreferences.edit().putInt(context.getString(R.string.VS_SOURCE),videoSource).commit();
VideoSettings.setVS_SOURCE(context,videoSource);
}

//Dang, I cannot get the Spinner work with an Espresso test
Expand Down Expand Up @@ -71,15 +69,13 @@ private static void validateDecodingInfo(final @Nullable DecodingInfo info){

@Test
public void playAllTestVideosTest() {
writeVideoSource(VideoPlayer.VS_SOURCE_ASSETS);
writeVideoSource(VideoSettings.VS_SOURCE.ASSETS);
//Alternating, play x264 test video ,rpi cam, webcam
for(int i=0;i<N_ITERATIONS;i++){
selectVideoFilename(0);
testPlayVideo();
selectVideoFilename(1);
testPlayVideo();
selectVideoFilename(2);
testPlayVideo();
for(int j=0;j<7;j++){
selectVideoFilename(j);
testPlayVideo();
}
}
}

Expand Down

0 comments on commit ff790ff

Please sign in to comment.