Backed out changeset 6c865ed1f998 (bug 1641389) for perma failures on test_animation_operators.html. CLOSED TREE

This commit is contained in:
Razvan Maries 2020-05-28 05:43:40 +03:00
parent 7aa4fa01c1
commit b65c634b01
6 changed files with 21 additions and 5 deletions

View File

@ -7,7 +7,6 @@
#include "nsMimeTypes.h" #include "nsMimeTypes.h"
#include "mozilla/RefPtr.h" #include "mozilla/RefPtr.h"
#include "mozilla/StaticPrefs_image.h"
#include "AnimationSurfaceProvider.h" #include "AnimationSurfaceProvider.h"
#include "Decoder.h" #include "Decoder.h"
@ -77,7 +76,8 @@ DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
type = DecoderType::ICON; type = DecoderType::ICON;
// WebP // WebP
} else if (!strcmp(aMimeType, IMAGE_WEBP)) { } else if (!strcmp(aMimeType, IMAGE_WEBP) &&
StaticPrefs::image_webp_enabled()) {
type = DecoderType::WEBP; type = DecoderType::WEBP;
// AVIF // AVIF

View File

@ -58,8 +58,13 @@ nsresult mozilla::image::EnsureModuleInitialized() {
static ImageEnablementCookie kAVIFCookie = { static ImageEnablementCookie kAVIFCookie = {
mozilla::StaticPrefs::image_avif_enabled, mozilla::StaticPrefs::image_avif_enabled,
NS_LITERAL_CSTRING("image/avif")}; NS_LITERAL_CSTRING("image/avif")};
static ImageEnablementCookie kWebPCookie = {
mozilla::StaticPrefs::image_webp_enabled,
NS_LITERAL_CSTRING("image/webp")};
Preferences::RegisterCallbackAndCall(UpdateContentViewerRegistration, Preferences::RegisterCallbackAndCall(UpdateContentViewerRegistration,
"image.avif.enabled", &kAVIFCookie); "image.avif.enabled", &kAVIFCookie);
Preferences::RegisterCallbackAndCall(UpdateContentViewerRegistration,
"image.webp.enabled", &kWebPCookie);
mozilla::image::ShutdownTracker::Initialize(); mozilla::image::ShutdownTracker::Initialize();
mozilla::image::ImageFactory::Initialize(); mozilla::image::ImageFactory::Initialize();

View File

@ -36,8 +36,12 @@ AutoInitializeImageLib::AutoInitializeImageLib() {
EXPECT_TRUE(NS_IsMainThread()); EXPECT_TRUE(NS_IsMainThread());
sImageLibInitialized = true; sImageLibInitialized = true;
// Ensure WebP is enabled to run decoder tests.
nsresult rv = Preferences::SetBool("image.webp.enabled", true);
EXPECT_TRUE(rv == NS_OK);
// Ensure AVIF is enabled to run decoder tests. // Ensure AVIF is enabled to run decoder tests.
nsresult rv = Preferences::SetBool("image.avif.enabled", true); rv = Preferences::SetBool("image.avif.enabled", true);
EXPECT_TRUE(rv == NS_OK); EXPECT_TRUE(rv == NS_OK);
// Ensure that ImageLib services are initialized. // Ensure that ImageLib services are initialized.

View File

@ -159,7 +159,7 @@ function runTests()
SimpleTest.waitForExplicitFinish(); SimpleTest.waitForExplicitFinish();
SimpleTest.requestFlakyTimeout("untriaged"); SimpleTest.requestFlakyTimeout("untriaged");
runTests(); SpecialPowers.pushPrefEnv({"set": [["image.webp.enabled", true]]}, runTests);
</script> </script>
</pre> </pre>

View File

@ -37,7 +37,8 @@ var gNumDiscards = 0;
window.onload = function() { window.onload = function() {
// Enable discarding for the test. // Enable discarding for the test.
SpecialPowers.pushPrefEnv({ SpecialPowers.pushPrefEnv({
'set':[['image.mem.discardable',true]] 'set':[['image.mem.discardable',true],
['image.webp.enabled',true]]
}, runTest); }, runTest);
} }

View File

@ -4589,6 +4589,12 @@
value: -1 value: -1
mirror: once mirror: once
# Whether we attempt to decode WebP images or not.
- name: image.webp.enabled
type: RelaxedAtomicBool
value: true
mirror: always
# Whether we attempt to decode AVIF images or not. # Whether we attempt to decode AVIF images or not.
- name: image.avif.enabled - name: image.avif.enabled
type: RelaxedAtomicBool type: RelaxedAtomicBool