Skip to content

Commit

Permalink
Configure alpha as false explicitly on jpeg encode tests
Browse files Browse the repository at this point in the history
Jpeg encoding does not support alpha.

PiperOrigin-RevId: 432968779
  • Loading branch information
sjudd authored and glide-copybara-robot committed Mar 7, 2022
1 parent ad35f5e commit 14b3bf5
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -42,13 +42,16 @@ public void tearDown() {

@Test
public void testBitmapIsEncoded() throws IOException {
harness.bitmap.setHasAlpha(false);

assertThat(harness.encode()).isEqualTo(harness.expectedData(CompressFormat.JPEG, 90));
}

@Test
public void testBitmapIsEncodedWithGivenQuality() throws IOException {
int quality = 7;
harness.setQuality(quality);
harness.bitmap.setHasAlpha(false);

assertThat(harness.encode()).isEqualTo(harness.expectedData(CompressFormat.JPEG, quality));
}
Expand Down

0 comments on commit 14b3bf5

Please sign in to comment.