Fix CanDecodeType test failure if AVIF is disabled
Fix the ImageDecoderTest.CanDecodeType test failure when the AVIF feature is disabled. The ImageDecoderExternal::canDecodeType() method ultimately depends on what is added to image_types_ in the MimeUtil constructor: MimeUtil::MimeUtil() { ... for (const char* type : kSupportedImageTypes) image_types_.insert(type); #if BUILDFLAG(ENABLE_AV1_DECODER) ... if (base::FeatureList::IsEnabled(features::kAVIF)) image_types_.insert("image/avif"); #endif So the return value of ImageDecoderExternal::canDecodeType("image/avif") should match base::FeatureList::IsEnabled(features::kAVIF). Test: blink_unittests --enable-features=AVIF \ --gtest_filter=ImageDecoderTest.CanDecodeType blink_unittests --disable-features=AVIF \ --gtest_filter=ImageDecoderTest.CanDecodeType Bug: 1116502 Change-Id: Idb5a13f5cc4e78c0d9671b7460601a412936bec9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357961Reviewed-by:Peter Kasting <pkasting@chromium.org> Reviewed-by:
Thomas Guilbert <tguilbert@chromium.org> Reviewed-by:
Dan Sanders <sandersd@chromium.org> Commit-Queue: Wan-Teh Chang <wtc@google.com> Cr-Commit-Position: refs/heads/master@{#798361}
Showing
Please register or sign in to comment