Skip to content

Commit

Permalink
Move MediaExtractorCompatTest from test/ to androidTest/
Browse files Browse the repository at this point in the history
The test has been moved to an instrumentation test as it relies on APIs that vary by SDK version. Robolectric’s emulation lacks sufficient realism in some cases, which impacts test accuracy. By using an instrumentation test, we ensure that the tests run in a real Android environment, providing reliable results for SDK-dependent APIs.

PiperOrigin-RevId: 692933259
(cherry picked from commit 261ca32)
  • Loading branch information
rohitjoins authored and icbaker committed Nov 19, 2024
1 parent 761cf4a commit 09be7b0
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import androidx.media3.extractor.SeekMap.SeekPoints;
import androidx.media3.extractor.SeekPoint;
import androidx.media3.extractor.TrackOutput;
import androidx.media3.test.utils.AssetContentProvider;
import androidx.media3.test.utils.TestUtil;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
Expand Down Expand Up @@ -567,8 +566,7 @@ public void seek_withException_producesEndOfInput() throws IOException {
public void setDataSourceUsingMethodExpectingContentUri_useContentUri_setsTrackCountCorrectly()
throws IOException {
Context context = ApplicationProvider.getApplicationContext();
Uri contentUri =
AssetContentProvider.buildUri(/* filePath= */ "media/mp4/sample.mp4", /* pipeMode= */ true);
Uri contentUri = Uri.parse("asset:///media/mp4/sample.mp4");
MediaExtractorCompat mediaExtractorCompat = new MediaExtractorCompat(context);

mediaExtractorCompat.setDataSource(context, contentUri, /* headers= */ null);
Expand Down

0 comments on commit 09be7b0

Please sign in to comment.