mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Bug 1676925 - Remove code supporting the defunct WebRender experiments. r=jrmuizel,marionette-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96943
This commit is contained in:
parent
4f8f4ad16b
commit
14c1a2a995
@ -1,163 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "WebRenderRollout.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/ScopeExit.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
static const char* const WR_ROLLOUT_PREF = "gfx.webrender.all.qualified";
|
||||
static const bool WR_ROLLOUT_PREF_DEFAULTVALUE = true;
|
||||
static const char* const WR_ROLLOUT_DEFAULT_PREF =
|
||||
"gfx.webrender.all.qualified.default";
|
||||
static const bool WR_ROLLOUT_DEFAULT_PREF_DEFAULTVALUE = false;
|
||||
static const char* const WR_ROLLOUT_PREF_OVERRIDE =
|
||||
"gfx.webrender.all.qualified.gfxPref-default-override";
|
||||
static const char* const WR_ROLLOUT_HW_QUALIFIED_OVERRIDE =
|
||||
"gfx.webrender.all.qualified.hardware-override";
|
||||
static const char* const PROFILE_BEFORE_CHANGE_TOPIC = "profile-before-change";
|
||||
|
||||
// If the "gfx.webrender.all.qualified" pref is true we want to enable
|
||||
// WebRender for qualified hardware. This pref may be set by the Normandy
|
||||
// Preference Rollout feature. The Normandy pref rollout code sets default
|
||||
// values on rolled out prefs on every startup. Default pref values are not
|
||||
// persisted; they only exist in memory for that session. Gfx starts up
|
||||
// before Normandy does. So it's too early to observe the WR qualified pref
|
||||
// changed by Normandy rollout on gfx startup. So we add a shutdown observer to
|
||||
// save the default value on shutdown, and read the saved value on startup
|
||||
// instead.
|
||||
class WrRolloutPrefShutdownSaver final : public nsIObserver {
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_IMETHOD Observe(nsISupports*, const char* aTopic,
|
||||
const char16_t*) override {
|
||||
if (strcmp(PROFILE_BEFORE_CHANGE_TOPIC, aTopic) != 0) {
|
||||
// Not the observer we're looking for, move along.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
SaveRolloutPref();
|
||||
|
||||
// Shouldn't receive another notification, remove the observer.
|
||||
RefPtr<WrRolloutPrefShutdownSaver> kungFuDeathGrip(this);
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
if (NS_WARN_IF(!observerService)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
observerService->RemoveObserver(this, PROFILE_BEFORE_CHANGE_TOPIC);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static void AddShutdownObserver() {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
mozilla::services::GetObserverService();
|
||||
if (NS_WARN_IF(!observerService)) {
|
||||
return;
|
||||
}
|
||||
RefPtr<WrRolloutPrefShutdownSaver> wrRolloutSaver =
|
||||
new WrRolloutPrefShutdownSaver();
|
||||
observerService->AddObserver(wrRolloutSaver, PROFILE_BEFORE_CHANGE_TOPIC,
|
||||
false);
|
||||
}
|
||||
|
||||
private:
|
||||
virtual ~WrRolloutPrefShutdownSaver() = default;
|
||||
|
||||
void SaveRolloutPref() {
|
||||
if (Preferences::HasUserValue(WR_ROLLOUT_PREF) ||
|
||||
Preferences::GetType(WR_ROLLOUT_PREF) == nsIPrefBranch::PREF_INVALID) {
|
||||
// Don't need to create a backup of default value, because either:
|
||||
// 1. the user or the WR SHIELD study has set a user pref value, or
|
||||
// 2. we've not had a default pref set by Normandy that needs to be saved
|
||||
// for reading before Normandy has started up.
|
||||
return;
|
||||
}
|
||||
|
||||
bool defaultValue =
|
||||
Preferences::GetBool(WR_ROLLOUT_PREF, false, PrefValueKind::Default);
|
||||
Preferences::SetBool(WR_ROLLOUT_DEFAULT_PREF, defaultValue);
|
||||
}
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS(WrRolloutPrefShutdownSaver, nsIObserver)
|
||||
|
||||
/* static */ void WebRenderRollout::Init() {
|
||||
WrRolloutPrefShutdownSaver::AddShutdownObserver();
|
||||
}
|
||||
|
||||
/* static */ Maybe<bool> WebRenderRollout::CalculateQualifiedOverride() {
|
||||
// This pref only ever gets set in test_pref_rollout_workaround, and in
|
||||
// that case we want to ignore the MOZ_WEBRENDER=0 that will be set by
|
||||
// the test harness so as to actually make the test work.
|
||||
if (!Preferences::HasUserValue(WR_ROLLOUT_HW_QUALIFIED_OVERRIDE)) {
|
||||
return Nothing();
|
||||
}
|
||||
return Some(Preferences::GetBool(WR_ROLLOUT_HW_QUALIFIED_OVERRIDE, false));
|
||||
}
|
||||
|
||||
// If the "gfx.webrender.all.qualified" pref is true we want to enable
|
||||
// WebRender for qualifying hardware. The Normandy pref rollout code sets
|
||||
// default values on rolled out prefs on every startup, but Gfx starts up
|
||||
// before Normandy does. So it's too early to observe the WR qualified pref
|
||||
// default value changed by Normandy rollout here yet. So we have a shutdown
|
||||
// observer to save the default value on shutdown, and read the saved default
|
||||
// value here instead, and emulate the behavior of the pref system, with
|
||||
// respect to default/user values of the rollout pref.
|
||||
/* static */ bool WebRenderRollout::CalculateQualified() {
|
||||
auto clearPrefOnExit = MakeScopeExit([]() {
|
||||
// Clear the mirror of the default value of the rollout pref on scope exit,
|
||||
// if we have one. This ensures the user doesn't mess with the pref.
|
||||
// If we need it again, we'll re-create it on shutdown.
|
||||
Preferences::ClearUser(WR_ROLLOUT_DEFAULT_PREF);
|
||||
});
|
||||
|
||||
if (!Preferences::HasUserValue(WR_ROLLOUT_PREF) &&
|
||||
Preferences::HasUserValue(WR_ROLLOUT_DEFAULT_PREF)) {
|
||||
// The user has not set a user pref, and we have a default value set by the
|
||||
// shutdown observer. Let's use this as it should be the value Normandy set
|
||||
// before startup. WR_ROLLOUT_DEFAULT_PREF should only be set on shutdown by
|
||||
// the shutdown observer.
|
||||
// Normandy runs *during* startup, but *after* this code here runs (hence
|
||||
// the need for the workaround).
|
||||
// To have a value stored in the WR_ROLLOUT_DEFAULT_PREF pref here, during
|
||||
// the previous run Normandy must have set a default value on the in-memory
|
||||
// pref, and on shutdown we stored the default value in this
|
||||
// WR_ROLLOUT_DEFAULT_PREF user pref. Then once the user restarts, we
|
||||
// observe this pref. Normandy is the only way a default (not user) value
|
||||
// can be set for this pref.
|
||||
return Preferences::GetBool(WR_ROLLOUT_DEFAULT_PREF,
|
||||
WR_ROLLOUT_DEFAULT_PREF_DEFAULTVALUE);
|
||||
}
|
||||
|
||||
// We don't have a user value for the rollout pref, and we don't have the
|
||||
// value of the rollout pref at last shutdown stored. So we should fallback
|
||||
// to using the default. *But* if we're running
|
||||
// under the Marionette pref rollout work-around test, we may want to override
|
||||
// the default value expressed here, so we can test the "default disabled;
|
||||
// rollout pref enabled" case.
|
||||
// Note that those preferences can't be defined in all.js nor
|
||||
// StaticPrefsList.h as they would create the pref, leading SaveRolloutPref()
|
||||
// above to abort early as the pref would have a valid type.
|
||||
// We also don't want those prefs to appear in about:config.
|
||||
if (Preferences::HasUserValue(WR_ROLLOUT_PREF_OVERRIDE)) {
|
||||
return Preferences::GetBool(WR_ROLLOUT_PREF_OVERRIDE);
|
||||
}
|
||||
return Preferences::GetBool(WR_ROLLOUT_PREF, WR_ROLLOUT_PREF_DEFAULTVALUE);
|
||||
}
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
@ -1,27 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
#ifndef mozilla_gfx_config_WebRenderRollout_h
|
||||
#define mozilla_gfx_config_WebRenderRollout_h
|
||||
|
||||
#include "mozilla/Maybe.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
class WebRenderRollout final {
|
||||
public:
|
||||
static void Init();
|
||||
static Maybe<bool> CalculateQualifiedOverride();
|
||||
static bool CalculateQualified();
|
||||
|
||||
WebRenderRollout() = delete;
|
||||
~WebRenderRollout() = delete;
|
||||
};
|
||||
|
||||
} // namespace gfx
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_gfx_config_WebRenderRollout_h
|
@ -7,13 +7,13 @@
|
||||
#include "mozilla/gfx/gfxConfigManager.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs_gfx.h"
|
||||
#include "mozilla/StaticPrefs_layers.h"
|
||||
#include "gfxConfig.h"
|
||||
#include "gfxPlatform.h"
|
||||
#include "nsIGfxInfo.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "WebRenderRollout.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
# include "mozilla/WindowsVersion.h"
|
||||
@ -27,10 +27,6 @@ namespace gfx {
|
||||
void gfxConfigManager::Init() {
|
||||
MOZ_ASSERT(XRE_IsParentProcess());
|
||||
|
||||
WebRenderRollout::Init();
|
||||
mWrQualifiedOverride = WebRenderRollout::CalculateQualifiedOverride();
|
||||
mWrQualified = WebRenderRollout::CalculateQualified();
|
||||
|
||||
EmplaceUserPref("gfx.webrender.compositor", mWrCompositorEnabled);
|
||||
mWrForceEnabled = gfxPlatform::WebRenderPrefEnabled();
|
||||
mWrForceDisabled = StaticPrefs::gfx_webrender_force_disabled_AtStartup();
|
||||
@ -151,22 +147,12 @@ void gfxConfigManager::ConfigureWebRenderSoftware() {
|
||||
}
|
||||
}
|
||||
|
||||
bool gfxConfigManager::ConfigureWebRenderQualified() {
|
||||
void gfxConfigManager::ConfigureWebRenderQualified() {
|
||||
MOZ_ASSERT(mFeatureWrQualified);
|
||||
MOZ_ASSERT(mFeatureWrCompositor);
|
||||
|
||||
bool guarded = true;
|
||||
mFeatureWrQualified->EnableByDefault();
|
||||
|
||||
if (mWrQualifiedOverride) {
|
||||
if (!*mWrQualifiedOverride) {
|
||||
mFeatureWrQualified->Disable(
|
||||
FeatureStatus::BlockedOverride, "HW qualification pref override",
|
||||
"FEATURE_FAILURE_WR_QUALIFICATION_OVERRIDE"_ns);
|
||||
}
|
||||
return guarded;
|
||||
}
|
||||
|
||||
nsCString failureId;
|
||||
int32_t status;
|
||||
if (NS_FAILED(mGfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_WEBRENDER,
|
||||
@ -174,16 +160,11 @@ bool gfxConfigManager::ConfigureWebRenderQualified() {
|
||||
mFeatureWrQualified->Disable(FeatureStatus::BlockedNoGfxInfo,
|
||||
"gfxInfo is broken",
|
||||
"FEATURE_FAILURE_WR_NO_GFX_INFO"_ns);
|
||||
return guarded;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (status) {
|
||||
case nsIGfxInfo::FEATURE_ALLOW_ALWAYS:
|
||||
// We want to honour ALLOW_ALWAYS on beta and release, but on nightly,
|
||||
// we still want to perform experiments. A larger population is the most
|
||||
// useful, demote nightly to merely qualified.
|
||||
guarded = mIsNightly;
|
||||
break;
|
||||
case nsIGfxInfo::FEATURE_ALLOW_QUALIFIED:
|
||||
break;
|
||||
case nsIGfxInfo::FEATURE_DENIED:
|
||||
@ -223,8 +204,6 @@ bool gfxConfigManager::ConfigureWebRenderQualified() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return guarded;
|
||||
}
|
||||
|
||||
void gfxConfigManager::ConfigureWebRender() {
|
||||
@ -264,8 +243,7 @@ void gfxConfigManager::ConfigureWebRender() {
|
||||
}
|
||||
|
||||
ConfigureWebRenderSoftware();
|
||||
|
||||
bool guardedByQualifiedPref = ConfigureWebRenderQualified();
|
||||
ConfigureWebRenderQualified();
|
||||
|
||||
mFeatureWr->EnableByDefault();
|
||||
|
||||
@ -277,8 +255,7 @@ void gfxConfigManager::ConfigureWebRender() {
|
||||
mFeatureWr->UserForceEnable("Force enabled by envvar");
|
||||
} else if (mWrForceEnabled) {
|
||||
mFeatureWr->UserForceEnable("Force enabled by pref");
|
||||
} else if (mWrForceDisabled ||
|
||||
(mWrEnvForceDisabled && mWrQualifiedOverride.isNothing())) {
|
||||
} else if (mWrForceDisabled || mWrEnvForceDisabled) {
|
||||
// If the user set the pref to force-disable, let's do that. This
|
||||
// will override all the other enabling prefs
|
||||
// (gfx.webrender.enabled, gfx.webrender.all, and
|
||||
@ -294,12 +271,6 @@ void gfxConfigManager::ConfigureWebRender() {
|
||||
mFeatureWr->Disable(FeatureStatus::Disabled, "Not qualified",
|
||||
"FEATURE_FAILURE_NOT_QUALIFIED"_ns);
|
||||
}
|
||||
} else if (guardedByQualifiedPref && !mWrQualified) {
|
||||
// If the HW is qualified, we enable if either the HW has been qualified
|
||||
// on the release channel (i.e. it's no longer guarded by the qualified
|
||||
// pref), or if the qualified pref is enabled.
|
||||
mFeatureWr->Disable(FeatureStatus::Disabled, "Control group for experiment",
|
||||
"FEATURE_FAILURE_IN_EXPERIMENT"_ns);
|
||||
} else {
|
||||
// Otherwise we have qualified hardware, so we can disable the software
|
||||
// feature. Note that this doesn't override the force-enabled state set by
|
||||
|
@ -9,6 +9,8 @@
|
||||
#include "gfxFeature.h"
|
||||
#include "gfxTypes.h"
|
||||
|
||||
class nsIGfxInfo;
|
||||
|
||||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
@ -28,7 +30,6 @@ class gfxConfigManager {
|
||||
mWrForceEnabled(false),
|
||||
mWrForceDisabled(false),
|
||||
mWrCompositorForceEnabled(false),
|
||||
mWrQualified(false),
|
||||
mWrForceAngle(false),
|
||||
mWrForceAngleNoGPUProcess(false),
|
||||
mWrDCompWinEnabled(false),
|
||||
@ -51,7 +52,7 @@ class gfxConfigManager {
|
||||
|
||||
protected:
|
||||
void EmplaceUserPref(const char* aPrefName, Maybe<bool>& aValue);
|
||||
bool ConfigureWebRenderQualified();
|
||||
void ConfigureWebRenderQualified();
|
||||
void ConfigureWebRenderSoftware();
|
||||
|
||||
nsCOMPtr<nsIGfxInfo> mGfxInfo;
|
||||
@ -75,8 +76,6 @@ class gfxConfigManager {
|
||||
bool mWrForceEnabled;
|
||||
bool mWrForceDisabled;
|
||||
bool mWrCompositorForceEnabled;
|
||||
bool mWrQualified;
|
||||
Maybe<bool> mWrQualifiedOverride;
|
||||
bool mWrForceAngle;
|
||||
bool mWrForceAngleNoGPUProcess;
|
||||
bool mWrDCompWinEnabled;
|
||||
|
@ -21,7 +21,6 @@ UNIFIED_SOURCES += [
|
||||
"gfxConfigManager.cpp",
|
||||
"gfxFeature.cpp",
|
||||
"gfxVars.cpp",
|
||||
"WebRenderRollout.cpp",
|
||||
]
|
||||
|
||||
include("/ipc/chromium/chromium-config.mozbuild")
|
||||
|
@ -261,7 +261,6 @@ class GfxConfigManager : public ::testing::Test, public gfxConfigManager {
|
||||
mFeatureGPUProcess->EnableByDefault();
|
||||
|
||||
mWrCompositorEnabled.emplace(true);
|
||||
mWrQualified = true;
|
||||
mWrPartialPresent = true;
|
||||
mWrForceAngle = true;
|
||||
mWrDCompWinEnabled = true;
|
||||
@ -385,10 +384,10 @@ TEST_F(GfxConfigManager, WebRenderEnabledWithDisableHwCompositingNoWr) {
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderDisabledWithDisableHwCompositingNoWr) {
|
||||
mDisableHwCompositingNoWr = true;
|
||||
mWrQualified = false;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_DENIED;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
@ -402,33 +401,17 @@ TEST_F(GfxConfigManager, WebRenderDisabledWithDisableHwCompositingNoWr) {
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderDisabledWithAllowSoftwareGPUProcess) {
|
||||
mDisableHwCompositingNoWr = true;
|
||||
mWrQualified = false;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_DENIED;
|
||||
mGPUProcessAllowSoftware = true;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderQualifiedOverrideDisabled) {
|
||||
mWrQualifiedOverride.emplace(false);
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_FALSE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
@ -597,41 +580,6 @@ TEST_F(GfxConfigManager, WebRenderQualifiedAndBlocklistAllowAlways) {
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderNotQualifiedAndBlocklistAllowQualified) {
|
||||
mWrQualified = false;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_ALLOW_QUALIFIED;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderNotQualifiedAndBlocklistAllowAlways) {
|
||||
mWrQualified = false;
|
||||
mIsNightly = false;
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_ALLOW_ALWAYS;
|
||||
ConfigureWebRender();
|
||||
|
||||
EXPECT_TRUE(mFeatures.mWrQualified.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWr.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrCompositor.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrAngle.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrDComp.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mWrPartial.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mHwCompositing.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mGPUProcess.IsEnabled());
|
||||
EXPECT_TRUE(mFeatures.mD3D11HwAngle.IsEnabled());
|
||||
EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
|
||||
}
|
||||
|
||||
TEST_F(GfxConfigManager, WebRenderIntelBatteryNoHwStretchingNotNightly) {
|
||||
mIsNightly = false;
|
||||
++mHwStretchingSupport.mNone;
|
||||
@ -814,7 +762,7 @@ TEST_F(GfxConfigManager, WebRenderSofwareAndQualified) {
|
||||
TEST_F(GfxConfigManager, WebRenderSofwareAndNotQualified) {
|
||||
// Enabling software in gfxInfo when we're not qualified
|
||||
// results in WR software being enabled instead.
|
||||
mWrQualifiedOverride.emplace(false);
|
||||
mMockGfxInfo->mStatusWr = nsIGfxInfo::FEATURE_DENIED;
|
||||
mMockGfxInfo->mStatusWrSoftware = nsIGfxInfo::FEATURE_ALLOW_ALWAYS;
|
||||
ConfigureWebRender();
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
[DEFAULT]
|
||||
run-if = buildapp == 'browser'
|
||||
|
||||
[test_pref_rollout_workaround.py]
|
||||
skip-if = os != "win" # Bug 1503776, WebRender is only available on Windows at this stage.
|
@ -1,167 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from __future__ import absolute_import, print_function
|
||||
import platform
|
||||
from unittest import skipIf
|
||||
|
||||
from marionette_driver.by import By
|
||||
from marionette_harness.marionette_test import MarionetteTestCase
|
||||
|
||||
|
||||
gfx_rollout_override = "gfx.webrender.all.qualified.gfxPref-default-override"
|
||||
hw_qualified_override = "gfx.webrender.all.qualified.hardware-override"
|
||||
rollout_pref = "gfx.webrender.all.qualified"
|
||||
|
||||
|
||||
class WrPrefRolloutWorkAroundTestCase(MarionetteTestCase):
|
||||
"""Test cases for WebRender gradual pref rollout work around.
|
||||
Normandy sets default prefs when rolling out a pref change, but
|
||||
gfx starts up before Normandy can set the pref's default value
|
||||
so we save the default value on shutdown, and check it on startup.
|
||||
This test verifies that we save and load the default value,
|
||||
and that the right compositor is enabled due to the rollout.
|
||||
"""
|
||||
|
||||
def test_wr_rollout_workaround_on_non_qualifying_hw(self):
|
||||
# Override the StaticPrefs so that WR is not enabled, as it would be before a rollout.
|
||||
self.marionette.set_pref(pref=gfx_rollout_override, value=False)
|
||||
# Set HW override so we behave as if we on non-qualifying hardware.
|
||||
self.marionette.set_pref(pref=hw_qualified_override, value=False)
|
||||
# Ensure we don't fallback to the basic compositor for some spurious reason.
|
||||
self.marionette.set_pref(pref="layers.acceleration.force-enabled", value=True)
|
||||
|
||||
# Restart browser. Gfx will observe hardware qualification override, and
|
||||
# gfx rollout override prefs. We should then be running in a browser which
|
||||
# behaves as if it's running on hardware that does not qualify for WR,
|
||||
# with WR not rolled out yet.
|
||||
self.marionette.restart(clean=False, in_app=True)
|
||||
|
||||
# Ensure we're not yet using WR; we're not rolled out yet!
|
||||
status, compositor = self.wr_status()
|
||||
print("self.wr_status()={},{}".format(status, compositor))
|
||||
self.assertEqual(
|
||||
status,
|
||||
"disabled:FEATURE_FAILURE_NOT_QUALIFIED",
|
||||
"Should start out as WR disabled, not qualified",
|
||||
)
|
||||
self.assertTrue(
|
||||
compositor != "webrender",
|
||||
"Before WR rollout on non-qualifying HW, should not be using WR.",
|
||||
)
|
||||
|
||||
# Set the rollout pref's default value, as Normandy would do, and restart.
|
||||
# Gfx's shutdown observer should save the default value of the pref. Upon
|
||||
# restart, because we're pretending to be on *non-qualifying* hardware, WR
|
||||
# should be reported as blocked.
|
||||
self.marionette.set_pref(pref=rollout_pref, value=True, default_branch=True)
|
||||
self.marionette.restart(clean=False, in_app=True)
|
||||
status, compositor = self.wr_status()
|
||||
print("self.wr_status()={},{}".format(status, compositor))
|
||||
self.assertEqual(
|
||||
status,
|
||||
"disabled:FEATURE_FAILURE_NOT_QUALIFIED",
|
||||
"WR rolled out on non-qualifying hardware should not use WR.",
|
||||
)
|
||||
self.assertTrue(
|
||||
compositor != "webrender",
|
||||
"WR rolled out on non-qualifying HW should not be used.",
|
||||
)
|
||||
|
||||
# Simulate a rollback of the rollout; set the pref to false at runtime.
|
||||
self.marionette.set_pref(pref=rollout_pref, value=False, default_branch=True)
|
||||
self.marionette.restart(clean=False, in_app=True)
|
||||
status, compositor = self.wr_status()
|
||||
print("self.wr_status()={},{}".format(status, compositor))
|
||||
self.assertEqual(
|
||||
status,
|
||||
"disabled:FEATURE_FAILURE_NOT_QUALIFIED",
|
||||
"WR rollback of rollout should revert to disabled on non-qualifying hardware.",
|
||||
)
|
||||
self.assertTrue(
|
||||
compositor != "webrender",
|
||||
"After roll back on non-qualifying HW, WR should not be used.",
|
||||
)
|
||||
|
||||
@skipIf(
|
||||
platform.machine() == "ARM64" and platform.system() == "Windows",
|
||||
"Bug 1536369 - Crashes on Windows 10 aarch64",
|
||||
)
|
||||
def test_wr_rollout_workaround_on_qualifying_hw(self):
|
||||
# Override the gfxPref so that WR is not enabled, as it would be before a rollout.
|
||||
self.marionette.set_pref(pref=gfx_rollout_override, value=False)
|
||||
# Set HW override so we behave as if we on qualifying hardware.
|
||||
self.marionette.set_pref(pref=hw_qualified_override, value=True)
|
||||
self.marionette.set_pref(pref="layers.acceleration.force-enabled", value=True)
|
||||
|
||||
# Restart browser. Gfx will observe hardware qualification override, and
|
||||
# gfx rollout override prefs. We should then be running in a browser which
|
||||
# behaves as if it's running on *qualifying* hardware, with WR not rolled
|
||||
# out yet.
|
||||
self.marionette.restart(clean=False, in_app=True)
|
||||
|
||||
# Ensure we're not yet using WR; we're not rolled out yet!
|
||||
status, compositor = self.wr_status()
|
||||
print("self.wr_status()={},{}".format(status, compositor))
|
||||
self.assertEqual(
|
||||
status,
|
||||
"disabled:FEATURE_FAILURE_IN_EXPERIMENT",
|
||||
"Should start out as WR disabled, in experiment",
|
||||
)
|
||||
self.assertTrue(
|
||||
compositor != "webrender",
|
||||
"Before WR rollout on qualifying HW, should not be using WR.",
|
||||
)
|
||||
|
||||
# Set the rollout pref's default value, as Normandy would do, and restart.
|
||||
# Gfx's shutdown observer should save the default value of the pref. Upon
|
||||
# restart, because we're pretending to be on *qualifying* hardware, WR
|
||||
# should be reported as available.
|
||||
self.marionette.set_pref(pref=rollout_pref, value=True, default_branch=True)
|
||||
self.marionette.restart(clean=False, in_app=True)
|
||||
status, compositor = self.wr_status()
|
||||
print("self.wr_status()={},{}".format(status, compositor))
|
||||
self.assertEqual(
|
||||
status,
|
||||
"available",
|
||||
"WR rolled out on qualifying hardware should report be available #1.",
|
||||
)
|
||||
self.assertEqual(
|
||||
compositor,
|
||||
"webrender",
|
||||
"After rollout on qualifying HW, WR should be used.",
|
||||
)
|
||||
|
||||
# Simulate a rollback of the rollout; set the pref to false at runtime.
|
||||
self.marionette.set_pref(pref=rollout_pref, value=False, default_branch=True)
|
||||
self.marionette.restart(clean=False, in_app=True)
|
||||
status, compositor = self.wr_status()
|
||||
print("self.wr_status()={},{}".format(status, compositor))
|
||||
self.assertEqual(
|
||||
status,
|
||||
"disabled:FEATURE_FAILURE_IN_EXPERIMENT",
|
||||
"WR rollback of rollout should revert to disabled on qualifying hardware.",
|
||||
)
|
||||
self.assertTrue(
|
||||
compositor != "webrender",
|
||||
"After roll back on qualifying HW, WR should not be used.",
|
||||
)
|
||||
|
||||
def wr_status(self):
|
||||
self.marionette.set_context(self.marionette.CONTEXT_CHROME)
|
||||
result = self.marionette.execute_script(
|
||||
"""
|
||||
try {
|
||||
const gfxInfo = Components.classes['@mozilla.org/gfx/info;1'].getService(Ci.nsIGfxInfo);
|
||||
return {features: gfxInfo.getFeatures(), log: gfxInfo.getFeatureLog()};
|
||||
} catch (e) {
|
||||
return {}
|
||||
}
|
||||
"""
|
||||
)
|
||||
return (
|
||||
result["features"]["webrender"]["status"],
|
||||
result["features"]["compositor"],
|
||||
)
|
@ -7,4 +7,3 @@
|
||||
MOCHITEST_MANIFESTS += ["mochitest/mochitest.ini"]
|
||||
BROWSER_CHROME_MANIFESTS += ["browser/browser.ini"]
|
||||
MOCHITEST_CHROME_MANIFESTS += ["chrome/chrome.ini"]
|
||||
MARIONETTE_GPU_MANIFESTS += ["marionette/manifest.ini"]
|
||||
|
@ -139,7 +139,6 @@ ARCHIVE_FILES = {
|
||||
"base": "",
|
||||
"manifests": [
|
||||
"testing/marionette/harness/marionette_harness/tests/unit-tests.ini",
|
||||
"gfx/tests/marionette/manifest.ini",
|
||||
],
|
||||
# We also need the manifests and harness_unit tests
|
||||
"pattern": "testing/marionette/harness/marionette_harness/tests/**",
|
||||
|
@ -2239,12 +2239,6 @@ VARIABLES = {
|
||||
"""List of manifest files defining marionette-layout tests.
|
||||
""",
|
||||
),
|
||||
"MARIONETTE_GPU_MANIFESTS": (
|
||||
ManifestparserManifestList,
|
||||
list,
|
||||
"""List of manifest files defining marionette-gpu tests.
|
||||
""",
|
||||
),
|
||||
"MARIONETTE_UNIT_MANIFESTS": (
|
||||
ManifestparserManifestList,
|
||||
list,
|
||||
|
@ -67,12 +67,3 @@ marionette-headless:
|
||||
mozharness:
|
||||
extra-options:
|
||||
- --headless
|
||||
|
||||
marionette-gpu:
|
||||
description: "Marionette with GPU unittest run"
|
||||
treeherder-symbol: MnG
|
||||
max-run-time: 1800
|
||||
instance-size: default
|
||||
mozharness:
|
||||
extra-options:
|
||||
- --test-manifest gpu-unit-tests.ini
|
||||
|
@ -227,11 +227,6 @@ windows7-32-qr/opt:
|
||||
- web-platform-tests
|
||||
|
||||
# win64
|
||||
windows10-64-ccov/opt:
|
||||
build-platform: win64-ccov/opt
|
||||
test-sets:
|
||||
- marionette-gpu-tests # fails on -qr because one test requires WR disabled
|
||||
|
||||
windows10-64-ccov-qr/opt:
|
||||
build-platform: win64-ccov/opt
|
||||
test-sets:
|
||||
@ -249,7 +244,6 @@ windows10-64-ccov-qr/opt:
|
||||
windows10-64/debug:
|
||||
build-platform: win64/debug
|
||||
test-sets:
|
||||
- marionette-gpu-tests
|
||||
- mochitest-webgpu
|
||||
- windows-tests
|
||||
- windows10-tests
|
||||
@ -262,7 +256,6 @@ windows10-64/opt:
|
||||
- desktop-screenshot-capture
|
||||
- windows-talos
|
||||
- marionette-framescript
|
||||
- marionette-gpu-tests
|
||||
- windows-tests
|
||||
- windows10-tests
|
||||
- web-platform-tests
|
||||
@ -291,7 +284,6 @@ windows10-64-shippable/opt:
|
||||
- desktop-screenshot-capture
|
||||
- windows-talos
|
||||
- marionette-framescript
|
||||
- marionette-gpu-tests
|
||||
- windows-tests
|
||||
- windows10-tests
|
||||
- web-platform-tests
|
||||
@ -309,7 +301,6 @@ windows10-64-devedition/opt:
|
||||
build-platform: win64-devedition/opt
|
||||
test-sets:
|
||||
- desktop-screenshot-capture
|
||||
- marionette-gpu-tests
|
||||
- windows-tests
|
||||
- windows10-tests
|
||||
- web-platform-tests
|
||||
|
@ -187,9 +187,6 @@ ccov-code-coverage-tests:
|
||||
- test-coverage
|
||||
- test-coverage-wpt
|
||||
|
||||
marionette-gpu-tests:
|
||||
- marionette-gpu
|
||||
|
||||
mochitest-headless:
|
||||
- mochitest-plain-headless
|
||||
|
||||
|
@ -2808,7 +2808,6 @@
|
||||
"test-windows10-64-shippable-qr/opt-raptor-tp6-firefox-cold-docs-e10s",
|
||||
"test-linux1804-64-qr/debug-web-platform-tests-wdspec-fis-e10s-2",
|
||||
"test-linux1804-64-asan/opt-mochitest-devtools-chrome-e10s-5",
|
||||
"test-windows10-64/debug-marionette-gpu-fis-e10s",
|
||||
"test-windows10-64/opt-mochitest-a11y-1proc",
|
||||
"test-macosx1014-64-shippable/opt-raptor-tp6-firefox-cold-reddit-e10s",
|
||||
"test-macosx1014-64/debug-mochitest-media-e10s-1",
|
||||
@ -2868,7 +2867,6 @@
|
||||
"test-windows10-64/debug-web-platform-tests-reftest-e10s-5",
|
||||
"test-macosx1014-64-shippable/opt-mochitest-webgl2-ext-gli-e10s-2",
|
||||
"test-linux1804-64-qr/debug-web-platform-tests-reftest-e10s-1",
|
||||
"test-windows10-64/debug-marionette-gpu-e10s",
|
||||
"test-linux64-shippable-qr/opt-raptor-tp6-firefox-cold-yandex-e10s",
|
||||
"test-windows10-64-shippable/opt-raptor-tp6-firefox-cold-linkedin-e10s",
|
||||
"test-linux64-shippable/opt-talos-g1-e10s",
|
||||
@ -4270,7 +4268,6 @@
|
||||
"test-android-em-7.0-x86_64/debug-geckoview-web-platform-tests-reftest-e10s-2",
|
||||
"test-linux1804-64-asan/opt-web-platform-tests-e10s-1",
|
||||
"test-linux1804-64-asan/opt-mochitest-webgpu-e10s",
|
||||
"test-windows10-64/opt-marionette-gpu-e10s",
|
||||
"test-windows10-64-qr/opt-web-platform-tests-print-reftest-e10s",
|
||||
"test-linux1804-64-qr/debug-reftest-fis-e10s-1",
|
||||
"test-linux1804-64-asan/opt-mochitest-plain-e10s-6",
|
||||
|
@ -1,2 +0,0 @@
|
||||
# graphics tests
|
||||
[include:../../../../../gfx/tests/marionette/manifest.ini]
|
Loading…
Reference in New Issue
Block a user