Bug 1662508 - [2.0] Add media session artwork smoke tests. r=geckoview-reviewers,agi

Differential Revision: https://phabricator.services.mozilla.com/D89015
This commit is contained in:
Eugen Sawin 2020-09-08 15:59:28 +00:00
parent 22b2bc2103
commit f670bd7a5c
2 changed files with 24 additions and 4 deletions

View File

@ -50,7 +50,11 @@
title: "hoot",
artist: "owl",
album: "hoots",
artwork: [{src: "owl.png", type: "image/png", sizes: "16x16 32x32"}]
artwork: [{
src: "images/test.gif",
type: "image/gif",
sizes: "265x199"
}]
});
audio1.id = 0;
@ -61,7 +65,11 @@
title: "hoot2",
artist: "stillowl",
album: "dahoots",
artwork: [{src: "owl.png", type: "image/png", sizes: "16x16 32x32"}]
artwork: [{
src: "images/test.gif",
type: "image/gif",
sizes: "265x199"
}]
});
audio2.id = 1;
@ -72,7 +80,11 @@
title: "hoot3",
artist: "immaowl",
album: "mahoots",
artwork: [{src: "owl.png", type: "image/png", sizes: "16x16 32x32"}]
artwork: [{
src: "images/test.gif",
type: "image/gif",
sizes: "265x199"
}]
});
audio3.id = 2;

View File

@ -29,7 +29,7 @@ class Metadata(
title: String?,
artist: String?,
album: String?)
: MediaSession.Metadata(title, artist, album) {}
: MediaSession.Metadata(title, artist, album, null) {}
@RunWith(AndroidJUnit4::class)
@MediumTest
@ -227,6 +227,10 @@ class MediaSessionTest : BaseSessionTest() {
DOM_META[1].album,
DOM_META[2].album,
DOM_META[1].album)))
assertThat(
"Artwork image should be non-null",
meta.artwork!!.getBitmap(200),
notNullValue())
onMetadataCalled[sessionRule.currentCall.counter - 1]
.complete(null)
@ -599,6 +603,10 @@ class MediaSessionTest : BaseSessionTest() {
equalTo(forEachCall(
DOM_META[0].album,
DOM_META[1].album)))
assertThat(
"Artwork image should be non-null",
meta.artwork!!.getBitmap(200),
notNullValue())
}
@AssertCalled(count = 2)