Skip to content

Commit

Permalink
Bug 1727033 - Firefox can't shows avif image returned by Cloudflare C…
Browse files Browse the repository at this point in the history
…DN with CF's "image-resizing" feature enabled. r=tnikkel

This commit merely adds a test to validate the fix which occurs in the
mp4parse-rust code updated in the previous commit.

Differential Revision: https://phabricator.services.mozilla.com/D123991
  • Loading branch information
baumanj committed Aug 31, 2021
1 parent a428622 commit 364e4b7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions image/test/gtest/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ ImageTestCase GreenAVIFTestCase() {
return ImageTestCase("green.avif", "image/avif", IntSize(100, 100));
}

ImageTestCase NonzeroReservedAVIFTestCase() {
auto testCase = ImageTestCase("hdlr-nonzero-reserved-bug-1727033.avif",
"image/avif", IntSize(1, 1));
testCase.mColor = BGRAColor(0x00, 0x00, 0x00, 0xFF);
return testCase;
}

ImageTestCase Transparent10bit420AVIFTestCase() {
auto testCase =
ImageTestCase("transparent-green-50pct-10bit-yuv420.avif", "image/avif",
Expand Down
1 change: 1 addition & 0 deletions image/test/gtest/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ ImageTestCase GreenIconTestCase();
ImageTestCase GreenWebPTestCase();
ImageTestCase GreenAVIFTestCase();

ImageTestCase NonzeroReservedAVIFTestCase();
ImageTestCase Transparent10bit420AVIFTestCase();
ImageTestCase Transparent10bit422AVIFTestCase();
ImageTestCase Transparent10bit444AVIFTestCase();
Expand Down
4 changes: 4 additions & 0 deletions image/test/gtest/TestDecoders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@ TEST_F(ImageDecoders, AVIFSingleChunk) {
CheckDecoderSingleChunk(GreenAVIFTestCase());
}

TEST_F(ImageDecoders, AVIFSingleChunkNonzeroReserved) {
CheckDecoderSingleChunk(NonzeroReservedAVIFTestCase());
}

TEST_F(ImageDecoders, AVIFSingleChunkTransparent10bit420) {
CheckDecoderSingleChunk(Transparent10bit420AVIFTestCase());
}
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions image/test/gtest/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ TEST_HARNESS_FILES.gtest += [
"green.jxl",
"green.png",
"green.webp",
"hdlr-nonzero-reserved-bug-1727033.avif",
"invalid-truncated-metadata.bmp",
"large.avif",
"large.jxl",
Expand Down

0 comments on commit 364e4b7

Please sign in to comment.