DefaultAvPlayer implements AvPlayer { @Override public void play(@NonNull Callback callback, @NonNull ErrorCallback errorCallback) { if (state.isLoaded() && !state.isPlaying()) { state.setPlaying(); player.play(new StopCallbackWrapper(callback), new StopErrorCallbackWrapper(errorCallback)); } else { state.setPlaying(); } } DefaultAvPlayer(@NonNull AvPlayerImplementation player); @Override void deinit(); @Override void init(); @Override void load(@NonNull String path,
                     @NonNull final Callback callback,
                     @NonNull final ErrorCallback errorCallback); @Override void stop(); @Override void play(@NonNull Callback callback, @NonNull ErrorCallback errorCallback); @Override void play(@NonNull String path,
                     @NonNull Callback callback,
                     @NonNull ErrorCallback errorCallback); @Override void pause();  }
@Test public void testLoadPlay() { play(PATH_A); verifyLoad(1, PATH_A); verifyCallback(1); verifyErrorCallback(0); }
@Test public void testPlayPlaySync() { play(PATH_A); play(PATH_A); verifyPlay(2); verifyCallback(2); verifyErrorCallback(0); }
@Test public void testPlayPlaySyncFail() { implementation.setSyncPlayFailure(true); play(PATH_A); verifyPlay(1); verifyCallback(0); verifyErrorCallback(1); }
@Test public void testPlayLoadSyncFail() { implementation.setSyncLoadFailure(true); play(PATH_A); verifyPlay(0); verifyCallback(0); verifyErrorCallback(1); }
@Test public void testPlayPlayAsync() { implementation.setAsyncPlayFailure(true); play(PATH_A); implementation.setAsyncPlayFailure(false); play(PATH_A); verifyPlay(1); verifyCallback(0); verifyErrorCallback(0); }