Test: Add non-mh androidTest tests to MH_TESTS / triage.

PiperOrigin-RevId: 549005874
This commit is contained in:
huangdarwin 2023-07-18 16:13:46 +01:00 committed by Ian Baker
parent 8064c6df83
commit 747b31b3c5
5 changed files with 155 additions and 1 deletions

View File

@ -17,6 +17,7 @@
package androidx.media3.transformer;
import static androidx.media3.transformer.AndroidTestUtil.FORCE_TRANSCODE_VIDEO_EFFECTS;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_FORMAT;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_FRAME_COUNT;
import static com.google.common.truth.Truth.assertThat;
@ -57,6 +58,13 @@ public class ForceEndOfStreamTest {
if (skipTestBelowApi29(context, testId)) {
return;
}
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
int framesToSkip = 4;
ExportTestResult testResult =
@ -76,6 +84,13 @@ public class ForceEndOfStreamTest {
if (skipTestBelowApi29(context, testId)) {
return;
}
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
ExportTestResult testResult =
new TransformerAndroidTestRunner.Builder(

View File

@ -17,7 +17,9 @@ package androidx.media3.transformer;
import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.transformer.AndroidTestUtil.MP3_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_FORMAT;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S_FORMAT;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.PNG_ASSET_URI_STRING;
@ -222,6 +224,14 @@ public class TransformerEndToEndTest {
@Test
public void videoEditing_completesWithConsistentFrameCount() throws Exception {
String testId = "videoEditing_completesWithConsistentFrameCount";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(
@ -246,6 +256,14 @@ public class TransformerEndToEndTest {
@Test
public void videoEditing_effectsOverTime_completesWithConsistentFrameCount() throws Exception {
String testId = "videoEditing_effectsOverTime_completesWithConsistentFrameCount";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(
@ -281,6 +299,14 @@ public class TransformerEndToEndTest {
@Test
public void videoOnly_completesWithConsistentDuration() throws Exception {
String testId = "videoOnly_completesWithConsistentDuration";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(
@ -303,6 +329,14 @@ public class TransformerEndToEndTest {
@Test
public void clippedMedia_completesWithClippedDuration() throws Exception {
String testId = "clippedMedia_completesWithClippedDuration";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S_FORMAT,
/* outputFormat= */ MP4_ASSET_WITH_INCREASING_TIMESTAMPS_320W_240H_15S_FORMAT)) {
return;
}
Transformer transformer = new Transformer.Builder(context).build();
long clippingStartMs = 10_000;
long clippingEndMs = 11_000;
@ -325,7 +359,15 @@ public class TransformerEndToEndTest {
}
@Test
public void videoEncoderFormatUnsupported_completesWithError() {
public void videoEncoderFormatUnsupported_completesWithError() throws Exception {
String testId = "videoEncoderFormatUnsupported_completesWithError";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(new VideoUnsupportedEncoderFactory(context))
@ -354,6 +396,13 @@ public class TransformerEndToEndTest {
public void audioVideoTranscodedFromDifferentSequences_producesExpectedResult() throws Exception {
Transformer transformer = new Transformer.Builder(context).build();
String testId = "audioVideoTranscodedFromDifferentSequences_producesExpectedResult";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
ImmutableList<AudioProcessor> audioProcessors = ImmutableList.of(new SonicAudioProcessor());
ImmutableList<Effect> videoEffects = ImmutableList.of(RgbFilter.createGrayscaleFilter());
MediaItem mediaItem = MediaItem.fromUri(Uri.parse(MP4_ASSET_URI_STRING));
@ -398,6 +447,13 @@ public class TransformerEndToEndTest {
public void loopingTranscodedAudio_producesExpectedResult() throws Exception {
Transformer transformer = new Transformer.Builder(context).build();
String testId = "loopingTranscodedAudio_producesExpectedResult";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
EditedMediaItem audioEditedMediaItem =
new EditedMediaItem.Builder(MediaItem.fromUri(MP3_ASSET_URI_STRING)).build();
EditedMediaItemSequence audioSequence =
@ -431,6 +487,13 @@ public class TransformerEndToEndTest {
public void loopingTranscodedVideo_producesExpectedResult() throws Exception {
Transformer transformer = new Transformer.Builder(context).build();
String testId = "loopingTranscodedVideo_producesExpectedResult";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
EditedMediaItem audioEditedMediaItem =
new EditedMediaItem.Builder(MediaItem.fromUri(MP3_ASSET_URI_STRING)).build();
EditedMediaItemSequence audioSequence =

View File

@ -18,6 +18,7 @@
package androidx.media3.transformer;
import static androidx.media3.transformer.AndroidTestUtil.JPG_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_FORMAT;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.PNG_ASSET_URI_STRING;
import static com.google.common.truth.Truth.assertThat;
@ -54,6 +55,13 @@ public class TransformerMixedInputEndToEndTest {
public void videoEditing_withImageThenVideoInputs_completesWithCorrectFrameCount()
throws Exception {
String testId = "videoEditing_withImageThenVideoInputs_completesWithCorrectFrameCount";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(
@ -81,6 +89,13 @@ public class TransformerMixedInputEndToEndTest {
public void videoEditing_withVideoThenImageInputs_completesWithCorrectFrameCount()
throws Exception {
String testId = "videoEditing_withVideoThenImageInputs_completesWithCorrectFrameCount";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(
@ -109,6 +124,13 @@ public class TransformerMixedInputEndToEndTest {
throws Exception {
String testId =
"videoEditing_withComplexVideoAndImageInputsEndWithVideo_completesWithCorrectFrameCount";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(
@ -147,6 +169,13 @@ public class TransformerMixedInputEndToEndTest {
throws Exception {
String testId =
"videoEditing_withComplexVideoAndImageInputsEndWithImage_completesWithCorrectFrameCount";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context)
.setEncoderFactory(

View File

@ -23,6 +23,7 @@ import static androidx.media3.test.utils.BitmapPixelTestUtil.maybeSaveTestBitmap
import static androidx.media3.test.utils.BitmapPixelTestUtil.readBitmap;
import static androidx.media3.transformer.AndroidTestUtil.JPG_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.JPG_PORTRAIT_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_FORMAT;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_URI_STRING;
import static androidx.media3.transformer.AndroidTestUtil.MP4_PORTRAIT_ASSET_URI_STRING;
import static com.google.common.truth.Truth.assertThat;
@ -74,6 +75,13 @@ public final class TransformerSequenceEffectTest {
@Test
public void export_withNoCompositionPresentationAndWithPerMediaItemEffects() throws Exception {
String testId = "export_withNoCompositionPresentationAndWithPerMediaItemEffects";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
OverlayEffect overlayEffect = createOverlayEffect();
Composition composition =
createComposition(
@ -111,6 +119,13 @@ public final class TransformerSequenceEffectTest {
@Test
public void export_withCompositionPresentationAndWithPerMediaItemEffects() throws Exception {
String testId = "export_withCompositionPresentationAndWithPerMediaItemEffects";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Composition composition =
createComposition(
Presentation.createForWidthAndHeight(
@ -144,6 +159,13 @@ public final class TransformerSequenceEffectTest {
@Test
public void export_withCompositionPresentationAndNoVideoEffects() throws Exception {
String testId = "export_withCompositionPresentationAndNoVideoEffects";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Composition composition =
createComposition(
Presentation.createForHeight(EXPORT_HEIGHT),
@ -166,6 +188,13 @@ public final class TransformerSequenceEffectTest {
public void export_withCompositionPresentationAndNoVideoEffectsForFirstMediaItem()
throws Exception {
String testId = "export_withCompositionPresentationAndNoVideoEffectsForFirstMediaItem";
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Composition composition =
createComposition(
Presentation.createForHeight(EXPORT_HEIGHT),

View File

@ -15,6 +15,8 @@
*/
package androidx.media3.transformer;
import static androidx.media3.transformer.AndroidTestUtil.MP4_ASSET_FORMAT;
import android.content.Context;
import android.net.Uri;
import androidx.media3.common.Effect;
@ -50,6 +52,14 @@ public class TransformerWithInAppMuxerEndToEndTest {
@Test
public void videoEditing_completesSuccessfully() throws Exception {
String testId = "videoEditing_completesSuccessfully";
// TODO ME This is an incorrect format used just to avoid needing to figure out the skip format
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context).setMuxerFactory(new InAppMuxer.Factory()).build();
ImmutableList<Effect> videoEffects = ImmutableList.of(RgbFilter.createGrayscaleFilter());
@ -67,6 +77,14 @@ public class TransformerWithInAppMuxerEndToEndTest {
@Test
public void audioEditing_completesSuccessfully() throws Exception {
String testId = "audioEditing_completesSuccessfully";
// TODO ME This is an incorrect format used just to avoid needing to figure out the skip format
if (AndroidTestUtil.skipAndLogIfFormatsUnsupported(
context,
testId,
/* inputFormat= */ MP4_ASSET_FORMAT,
/* outputFormat= */ MP4_ASSET_FORMAT)) {
return;
}
Transformer transformer =
new Transformer.Builder(context).setMuxerFactory(new InAppMuxer.Factory()).build();
ChannelMixingAudioProcessor channelMixingAudioProcessor = new ChannelMixingAudioProcessor();