Move classes that don't belong in testutils out of testutils

PiperOrigin-RevId: 278401000
This commit is contained in:
olly 2019-11-04 17:47:22 +00:00 committed by Oliver Woodman
parent d587def451
commit 9842ea7f22
14 changed files with 16 additions and 42 deletions

View File

@ -22,7 +22,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.extractor.ExtractorInput; import com.google.android.exoplayer2.extractor.ExtractorInput;
import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.testutil.TestUtil; import com.google.android.exoplayer2.testutil.TestUtil;
import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.ParsableByteArray;
import java.io.EOFException; import java.io.EOFException;

View File

@ -21,7 +21,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.testutil.ExtractorAsserts; import com.google.android.exoplayer2.testutil.ExtractorAsserts;
import com.google.android.exoplayer2.testutil.ExtractorAsserts.ExtractorFactory; import com.google.android.exoplayer2.testutil.ExtractorAsserts.ExtractorFactory;
import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.testutil.TestUtil; import com.google.android.exoplayer2.testutil.TestUtil;
import java.io.IOException; import java.io.IOException;
import org.junit.Test; import org.junit.Test;

View File

@ -20,7 +20,6 @@ import static com.google.common.truth.Truth.assertThat;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.testutil.TestUtil; import com.google.android.exoplayer2.testutil.TestUtil;
import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.ParsableByteArray;
import java.io.IOException; import java.io.IOException;

View File

@ -20,7 +20,6 @@ import static com.google.common.truth.Truth.assertThat;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.FakeExtractorInput.SimulatedIOException; import com.google.android.exoplayer2.testutil.FakeExtractorInput.SimulatedIOException;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.testutil.TestUtil; import com.google.android.exoplayer2.testutil.TestUtil;
import java.io.IOException; import java.io.IOException;
import org.junit.Test; import org.junit.Test;

View File

@ -13,10 +13,13 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.exoplayer2.testutil; package com.google.android.exoplayer2.extractor.ogg;
import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.TestUtil;
/** Provides ogg/vorbis test data in bytes for unit tests. */ /** Provides ogg/vorbis test data in bytes for unit tests. */
public final class OggTestData { /* package */ final class OggTestData {
public static FakeExtractorInput createInput(byte[] data, boolean simulateUnknownLength) { public static FakeExtractorInput createInput(byte[] data, boolean simulateUnknownLength) {
return new FakeExtractorInput.Builder() return new FakeExtractorInput.Builder()

View File

@ -17,7 +17,6 @@ package com.google.android.exoplayer2.extractor.ogg;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.testutil.TestUtil; import com.google.android.exoplayer2.testutil.TestUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;

View File

@ -24,7 +24,6 @@ import com.google.android.exoplayer2.extractor.ExtractorInput;
import com.google.android.exoplayer2.extractor.ogg.VorbisReader.VorbisSetup; import com.google.android.exoplayer2.extractor.ogg.VorbisReader.VorbisSetup;
import com.google.android.exoplayer2.testutil.FakeExtractorInput; import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.FakeExtractorInput.SimulatedIOException; import com.google.android.exoplayer2.testutil.FakeExtractorInput.SimulatedIOException;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.ParsableByteArray;
import java.io.IOException; import java.io.IOException;
import org.junit.Test; import org.junit.Test;

View File

@ -22,7 +22,6 @@ import static org.junit.Assert.fail;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.testutil.OggTestData;
import com.google.android.exoplayer2.util.ParsableByteArray; import com.google.android.exoplayer2.util.ParsableByteArray;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -17,10 +17,8 @@ package com.google.android.exoplayer2.playbacktests.gts;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
/** /** Test data for DASH tests. */
* Test data for DASH tests. /* package */ final class DashTestData {
*/
public final class DashTestData {
private static final String BASE_URL = private static final String BASE_URL =
"https://storage.googleapis.com/exoplayer-test-media-1/gen-4/"; "https://storage.googleapis.com/exoplayer-test-media-1/gen-4/";

View File

@ -40,12 +40,10 @@ import com.google.android.exoplayer2.source.TrackGroup;
import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.source.dash.DashMediaSource; import com.google.android.exoplayer2.source.dash.DashMediaSource;
import com.google.android.exoplayer2.testutil.ActionSchedule; import com.google.android.exoplayer2.testutil.ActionSchedule;
import com.google.android.exoplayer2.testutil.DebugRenderersFactory;
import com.google.android.exoplayer2.testutil.DecoderCountersUtil; import com.google.android.exoplayer2.testutil.DecoderCountersUtil;
import com.google.android.exoplayer2.testutil.ExoHostedTest; import com.google.android.exoplayer2.testutil.ExoHostedTest;
import com.google.android.exoplayer2.testutil.HostActivity; import com.google.android.exoplayer2.testutil.HostActivity;
import com.google.android.exoplayer2.testutil.HostActivity.HostedTest; import com.google.android.exoplayer2.testutil.HostActivity.HostedTest;
import com.google.android.exoplayer2.testutil.MetricsLogger;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector; import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.MappingTrackSelector; import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
import com.google.android.exoplayer2.trackselection.RandomTrackSelection; import com.google.android.exoplayer2.trackselection.RandomTrackSelection;
@ -62,7 +60,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
/** {@link DashHostedTest} builder. */ /** {@link DashHostedTest} builder. */
public final class DashTestRunner { /* package */ final class DashTestRunner {
static final int VIDEO_RENDERER_INDEX = 0; static final int VIDEO_RENDERER_INDEX = 0;
static final int AUDIO_RENDERER_INDEX = 1; static final int AUDIO_RENDERER_INDEX = 1;

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.exoplayer2.testutil; package com.google.android.exoplayer2.playbacktests.gts;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
@ -41,7 +41,7 @@ import java.util.ArrayList;
* video buffer timestamp assertions, and modifies the default value for {@link * video buffer timestamp assertions, and modifies the default value for {@link
* #setAllowedVideoJoiningTimeMs(long)} to be {@code 0}. * #setAllowedVideoJoiningTimeMs(long)} to be {@code 0}.
*/ */
public class DebugRenderersFactory extends DefaultRenderersFactory { /* package */ final class DebugRenderersFactory extends DefaultRenderersFactory {
public DebugRenderersFactory(Context context) { public DebugRenderersFactory(Context context) {
super(context); super(context);

View File

@ -25,7 +25,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.mediacodec.MediaCodecInfo; import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil; import com.google.android.exoplayer2.mediacodec.MediaCodecUtil;
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException; import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException;
import com.google.android.exoplayer2.testutil.MetricsLogger;
import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.exoplayer2.util.Util; import com.google.android.exoplayer2.util.Util;
import java.util.Arrays; import java.util.Arrays;

View File

@ -13,14 +13,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.exoplayer2.testutil; package com.google.android.exoplayer2.playbacktests.gts;
import com.google.android.exoplayer2.util.Log; import com.google.android.exoplayer2.util.Log;
/** /** Implementation of {@link MetricsLogger} that prints the metrics to logcat. */
* Implementation of {@link MetricsLogger} that prints the metrics to logcat. /* package */ final class LogcatMetricsLogger implements MetricsLogger {
*/
public final class LogcatMetricsLogger implements MetricsLogger {
private final String tag; private final String tag;
@ -33,11 +31,6 @@ public final class LogcatMetricsLogger implements MetricsLogger {
Log.d(tag, key + ": " + value); Log.d(tag, key + ": " + value);
} }
@Override
public void logMetric(String key, double value) {
Log.d(tag, key + ": " + value);
}
@Override @Override
public void logMetric(String key, String value) { public void logMetric(String key, String value) {
Log.d(tag, key + ": " + value); Log.d(tag, key + ": " + value);

View File

@ -13,12 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.google.android.exoplayer2.testutil; package com.google.android.exoplayer2.playbacktests.gts;
/** /** Metric logging interface for playback tests. */
* Metric Logging interface for ExoPlayer playback tests. /* package */ interface MetricsLogger {
*/
public interface MetricsLogger {
String KEY_FRAMES_DROPPED_COUNT = "frames_dropped_count"; String KEY_FRAMES_DROPPED_COUNT = "frames_dropped_count";
String KEY_FRAMES_RENDERED_COUNT = "frames_rendered_count"; String KEY_FRAMES_RENDERED_COUNT = "frames_rendered_count";
@ -35,14 +33,6 @@ public interface MetricsLogger {
*/ */
void logMetric(String key, int value); void logMetric(String key, int value);
/**
* Logs a double metric provided from a test.
*
* @param key The key of the metric to be logged.
* @param value The value of the metric to be logged.
*/
void logMetric(String key, double value);
/** /**
* Logs a string metric provided from a test. * Logs a string metric provided from a test.
* *