Skip to content

Commit 664dc6e

Browse files
rohitjoinsivanbuper
authored andcommitted
Add missing DefaultRenderersFactoryTest for decoder extensions
Added `DefaultRenderersFactoryTest` for `IAMF`, `AV1`, and `MIDI` decoder extensions. PiperOrigin-RevId: 691381816 (cherry picked from commit 27de9f0)
1 parent 4b6e886 commit 664dc6e

File tree

6 files changed

+142
-0
lines changed

6 files changed

+142
-0
lines changed

Diff for: libraries/decoder_av1/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,9 @@ dependencies {
5959
implementation project(modulePrefix + 'lib-exoplayer')
6060
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
6161
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
62+
testImplementation project(modulePrefix + 'test-utils')
63+
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
64+
androidTestImplementation project(modulePrefix + 'test-utils')
65+
androidTestImplementation 'androidx.test:runner:' + androidxTestRunnerVersion
66+
androidTestImplementation 'androidx.test.ext:junit:' + androidxTestJUnitVersion
6267
}

Diff for: libraries/decoder_av1/src/test/AndroidManifest.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2024 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<manifest package="androidx.media3.decoder.av1.test">
18+
<uses-sdk/>
19+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2024 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package androidx.media3.decoder.av1;
17+
18+
import androidx.media3.common.C;
19+
import androidx.media3.test.utils.DefaultRenderersFactoryAsserts;
20+
import androidx.test.ext.junit.runners.AndroidJUnit4;
21+
import org.junit.Test;
22+
import org.junit.runner.RunWith;
23+
24+
/** Unit test for {@link DefaultRenderersFactoryTest} with {@link Libgav1VideoRenderer}. */
25+
@RunWith(AndroidJUnit4.class)
26+
public final class DefaultRenderersFactoryTest {
27+
28+
@Test
29+
public void createRenderers_instantiatesAv1Renderer() {
30+
DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
31+
Libgav1VideoRenderer.class, C.TRACK_TYPE_VIDEO);
32+
}
33+
}

Diff for: libraries/decoder_iamf/src/test/AndroidManifest.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright 2024 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<manifest package="androidx.media3.decoder.iamf.test">
18+
<uses-sdk/>
19+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2024 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package androidx.media3.decoder.iamf;
17+
18+
import androidx.media3.common.C;
19+
import androidx.media3.test.utils.DefaultRenderersFactoryAsserts;
20+
import androidx.test.ext.junit.runners.AndroidJUnit4;
21+
import org.junit.Test;
22+
import org.junit.runner.RunWith;
23+
24+
/** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibiamfAudioRenderer}. */
25+
@RunWith(AndroidJUnit4.class)
26+
public final class DefaultRenderersFactoryTest {
27+
28+
@Test
29+
public void createRenderers_instantiatesIamfRenderer() {
30+
DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
31+
LibiamfAudioRenderer.class, C.TRACK_TYPE_AUDIO);
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2024 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package androidx.media3.decoder.midi;
17+
18+
import androidx.media3.common.C;
19+
import androidx.media3.test.utils.DefaultRenderersFactoryAsserts;
20+
import androidx.test.ext.junit.runners.AndroidJUnit4;
21+
import org.junit.Test;
22+
import org.junit.runner.RunWith;
23+
24+
/** Unit test for {@link DefaultRenderersFactoryTest} with {@link MidiRenderer}. */
25+
@RunWith(AndroidJUnit4.class)
26+
public final class DefaultRenderersFactoryTest {
27+
28+
@Test
29+
public void createRenderers_instantiatesMidiRenderer() {
30+
DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
31+
MidiRenderer.class, C.TRACK_TYPE_AUDIO);
32+
}
33+
}

0 commit comments

Comments
 (0)