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) |
{ |