Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp

Issue 2258523006: Convert Settings::rootLayerScrolls to RuntimeEnabledFeatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & fix mistake Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
index 00a1f7495079a177cf40c20bd4690cd672274346..4913162ae058f3bb9b065685c2494a51bdd574f2 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -11,10 +11,10 @@
namespace blink {
struct PaintLayerPainterTestParam {
- PaintLayerPainterTestParam(FrameSettingOverrideFunction frameSettingOverride, bool slimmingPaintV2)
- : frameSettingOverride(frameSettingOverride), slimmingPaintV2(slimmingPaintV2) { }
+ PaintLayerPainterTestParam(bool rootLayerScrolling, bool slimmingPaintV2)
+ : rootLayerScrolling(rootLayerScrolling), slimmingPaintV2(slimmingPaintV2) { }
- FrameSettingOverrideFunction frameSettingOverride;
+ bool rootLayerScrolling;
bool slimmingPaintV2;
};
@@ -23,15 +23,30 @@ class PaintLayerPainterTest
, public testing::WithParamInterface<PaintLayerPainterTestParam> {
USING_FAST_MALLOC(PaintLayerPainterTest);
public:
- PaintLayerPainterTest() : PaintControllerPaintTestBase(GetParam().slimmingPaintV2) { }
- FrameSettingOverrideFunction settingOverrider() const override { return GetParam().frameSettingOverride; }
+ PaintLayerPainterTest()
+ : PaintControllerPaintTestBase(GetParam().slimmingPaintV2)
+ , m_originalRootLayerScrollingEnabled(RuntimeEnabledFeatures::rootLayerScrollingEnabled())
+ , m_enableRootLayerScrolling(GetParam().rootLayerScrolling)
+ {
+ RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_enableRootLayerScrolling);
+ }
+
+ ~PaintLayerPainterTest()
+ {
+ CHECK_EQ(m_enableRootLayerScrolling, RuntimeEnabledFeatures::rootLayerScrollingEnabled());
+ RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_originalRootLayerScrollingEnabled);
+ }
+
+private:
+ bool m_originalRootLayerScrollingEnabled;
+ bool m_enableRootLayerScrolling;
};
INSTANTIATE_TEST_CASE_P(All, PaintLayerPainterTest, ::testing::Values(
- PaintLayerPainterTestParam(nullptr, false), // non-root-layer-scrolls, slimming-paint-v1
- PaintLayerPainterTestParam(nullptr, true), // non-root-layer-scrolls, slimming-paint-v2
- PaintLayerPainterTestParam(RootLayerScrollsFrameSettingOverride, false), // root-layer-scrolls, slimming-paint-v1
- PaintLayerPainterTestParam(RootLayerScrollsFrameSettingOverride, true))); // root-layer-scrolls, slimming-paint-v2
+ PaintLayerPainterTestParam(false, false), // non-root-layer-scrolls, slimming-paint-v1
+ PaintLayerPainterTestParam(false, true), // non-root-layer-scrolls, slimming-paint-v2
+ PaintLayerPainterTestParam(true, false), // root-layer-scrolls, slimming-paint-v1
+ PaintLayerPainterTestParam(true, true))); // root-layer-scrolls, slimming-paint-v2
TEST_P(PaintLayerPainterTest, CachedSubsequence)
{

Powered by Google App Engine
This is Rietveld 408576698