Skip to content

Commit

Permalink
Test: Rename to avoid redundant substrings.
Browse files Browse the repository at this point in the history
Rename test files to avoid substrings that can be implied by the directory name,
like "Transformation" and "Test"

No functional changes. Renaming-only.

PiperOrigin-RevId: 477724724
  • Loading branch information
dway123 authored and marcbaechinger committed Oct 20, 2022
1 parent 26a7360 commit 9786802
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import androidx.media3.common.FrameProcessor;
import androidx.media3.common.SurfaceInfo;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.testutil.DecodeOneFrameTestUtil;
import com.google.android.exoplayer2.testutil.DecodeOneFrameUtil;
import com.google.android.exoplayer2.video.ColorInfo;
import com.google.common.collect.ImmutableList;
import java.util.List;
Expand Down Expand Up @@ -464,9 +464,9 @@ public void onFrameProcessingEnded() {
DebugViewProvider.NONE,
ColorInfo.SDR_BT709_LIMITED,
/* releaseFramesAutomatically= */ true));
DecodeOneFrameTestUtil.decodeOneAssetFileFrame(
DecodeOneFrameUtil.decodeOneAssetFileFrame(
INPUT_MP4_ASSET_STRING,
new DecodeOneFrameTestUtil.Listener() {
new DecodeOneFrameUtil.Listener() {
@Override
public void onContainerExtracted(MediaFormat mediaFormat) {
glEffectsFrameProcessor.setInputFrameInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/** Tests repeated transcoding operations (as a stress test and to help reproduce flakiness). */
@RunWith(AndroidJUnit4.class)
public final class RepeatedTranscodeTransformationTest {
public final class RepeatedTranscodeTest {
private static final int TRANSCODE_COUNT = 10;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/** {@link Transformer} instrumentation test for applying a frame edit. */
@RunWith(AndroidJUnit4.class)
public class SetFrameEditTransformationTest {
public class SetFrameEditTest {
@Test
public void setFrameEditTransform() throws Exception {
Context context = ApplicationProvider.getApplicationContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_1080P_1_SECOND_HDR10_VIDEO_SDR_CONTAINER;
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_1080P_4_SECOND_HDR10;
import static com.google.android.exoplayer2.transformer.AndroidTestUtil.recordTestSkipped;
import static com.google.android.exoplayer2.transformer.mh.analysis.FileTestUtil.assertFileHasColorTransfer;
import static com.google.android.exoplayer2.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.android.exoplayer2.util.MimeTypes.VIDEO_H265;
import static com.google.common.truth.Truth.assertThat;
Expand All @@ -45,8 +45,8 @@
// TODO(b/239172735): Add HLG tests after finding a shareable HLG file.
/** {@link Transformer} instrumentation test for applying an HDR frame edit. */
@RunWith(AndroidJUnit4.class)
public class SetHdrEditingTransformationTest {
public static final String TAG = "SetHdrEditingTransformationTest";
public class SetHdrEditingTest {
public static final String TAG = "SetHdrEditingTest";
private static final ColorInfo HDR10_DEFAULT_COLOR_INFO =
new ColorInfo(
C.COLOR_SPACE_BT2020,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.google.android.exoplayer2.transformer.mh;

import static com.google.android.exoplayer2.transformer.AndroidTestUtil.MP4_ASSET_1080P_4_SECOND_HDR10;
import static com.google.android.exoplayer2.transformer.mh.analysis.FileTestUtil.assertFileHasColorTransfer;
import static com.google.android.exoplayer2.transformer.mh.analysis.FileUtil.assertFileHasColorTransfer;
import static com.google.android.exoplayer2.util.Assertions.checkNotNull;
import static com.google.common.truth.Truth.assertThat;

Expand All @@ -39,8 +39,8 @@
// TODO(b/239172735): Add HLG tests after finding a shareable HLG file.
/** {@link Transformer} instrumentation test for applying an HDR to SDR tone mapping edit. */
@RunWith(AndroidJUnit4.class)
public class SetHdrToSdrToneMapTransformationTest {
public static final String TAG = "SetHdrToSdrToneMapTransformationTest";
public class SetHdrToSdrToneMapTest {
public static final String TAG = "SetHdrToSdrToneMapTest";

@Test
public void transform_toneMapNoRequestedTranscode_hdr10File_toneMapsOrThrows() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@
import android.media.MediaFormat;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.DecodeOneFrameTestUtil;
import com.google.android.exoplayer2.testutil.DecodeOneFrameUtil;
import com.google.android.exoplayer2.util.MediaFormatUtil;
import com.google.android.exoplayer2.util.Util;
import com.google.android.exoplayer2.video.ColorInfo;

/** Utilities for reading color info from a file. */
public class FileTestUtil {
public class FileUtil {
public static void assertFileHasColorTransfer(
@Nullable String filePath, @C.ColorTransfer int expectedColorTransfer) throws Exception {
if (Util.SDK_INT < 29) {
// Skipping on this API version due to lack of support for MediaFormat#getInteger, which is
// required for MediaFormatUtil#getColorInfo.
return;
}
DecodeOneFrameTestUtil.decodeOneCacheFileFrame(
DecodeOneFrameUtil.decodeOneCacheFileFrame(
checkNotNull(filePath),
new DecodeOneFrameTestUtil.Listener() {
new DecodeOneFrameUtil.Listener() {
@Override
public void onContainerExtracted(MediaFormat mediaFormat) {
@Nullable ColorInfo extractedColor = MediaFormatUtil.getColorInfo(mediaFormat);
Expand All @@ -54,5 +54,5 @@ public void onFrameDecoded(MediaFormat mediaFormat) {
/* surface= */ null);
}

private FileTestUtil() {}
private FileUtil() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.checkerframework.checker.nullness.qual.Nullable;

/** Utilities for decoding a frame for tests. */
public class DecodeOneFrameTestUtil {
public class DecodeOneFrameUtil {

/** Listener for decoding events. */
public interface Listener {
Expand Down Expand Up @@ -171,5 +171,5 @@ private static void decodeOneFrame(
}
}

private DecodeOneFrameTestUtil() {}
private DecodeOneFrameUtil() {}
}

0 comments on commit 9786802

Please sign in to comment.