Update InternetConnection check to skip check when uri scheme is null

When we created androidTests, in the past, they always had a URI pointing to a resource, therefore we always had a URI scheme. With texture input, this will not longer be the case (EditedMediaItems's may have URI.EMPTY, which have a null scheme) so we need to check for this so tests don't falsely fail.

PiperOrigin-RevId: 528848411
This commit is contained in:
tofunmi 2023-05-02 19:53:46 +01:00 committed by Marc Baechinger
parent d5fc9e9627
commit 3011a29940

View file

@ -274,8 +274,8 @@ public class TransformerAndroidTestRunner {
for (EditedMediaItemSequence sequence : composition.sequences) {
for (EditedMediaItem editedMediaItem : sequence.editedMediaItems) {
Uri mediaItemUri = checkNotNull(editedMediaItem.mediaItem.localConfiguration).uri;
String scheme = checkNotNull(mediaItemUri.getScheme());
if ((scheme.equals("http") || scheme.equals("https"))) {
String scheme = mediaItemUri.getScheme();
if (scheme != null && (scheme.equals("http") || scheme.equals("https"))) {
assumeTrue(
"Input network file requested on device with no network connection. Input file"
+ " name: "