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

Unified Diff: third_party/WebKit/Source/core/frame/FrameViewTest.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/frame/FrameViewTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameViewTest.cpp b/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
index 5438ffa3f6faa0fd4d4b988dacfb5034e893a72a..614ecb81339079162b42475e983cc4dde144d44b 100644
--- a/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameViewTest.cpp
@@ -38,17 +38,24 @@ public:
bool m_hasScheduledAnimation;
};
+typedef bool TestParamRootLayerScrolling;
class FrameViewTestBase
: public testing::Test
- , public testing::WithParamInterface<FrameSettingOverrideFunction> {
+ , public testing::WithParamInterface<TestParamRootLayerScrolling> {
protected:
FrameViewTestBase()
: m_chromeClient(new MockChromeClient)
- { }
+ , m_originalRootLayerScrollingEnabled(RuntimeEnabledFeatures::rootLayerScrollingEnabled())
+ , m_enableRootLayerScrolling(GetParam())
+ {
+ RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_enableRootLayerScrolling);
+ }
~FrameViewTestBase()
{
testing::Mock::VerifyAndClearExpectations(&chromeClient());
+ CHECK_EQ(m_enableRootLayerScrolling, RuntimeEnabledFeatures::rootLayerScrollingEnabled());
+ RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_originalRootLayerScrollingEnabled);
}
void SetUp() override
@@ -58,8 +65,6 @@ protected:
clients.chromeClient = m_chromeClient.get();
m_pageHolder = DummyPageHolder::create(IntSize(800, 600), &clients);
m_pageHolder->page().settings().setAcceleratedCompositingEnabled(true);
- if (GetParam())
- (*GetParam())(m_pageHolder->page().settings());
}
Document& document() { return m_pageHolder->document(); }
@@ -68,6 +73,8 @@ protected:
private:
Persistent<MockChromeClient> m_chromeClient;
std::unique_ptr<DummyPageHolder> m_pageHolder;
+ bool m_originalRootLayerScrollingEnabled;
+ bool m_enableRootLayerScrolling;
};
class FrameViewTest : public FrameViewTestBase {
@@ -104,13 +111,8 @@ private:
RuntimeEnabledFeatures::Backup m_featuresBackup;
};
-INSTANTIATE_TEST_CASE_P(All, FrameViewTest, ::testing::Values(
- nullptr,
- &RootLayerScrollsFrameSettingOverride));
-
-INSTANTIATE_TEST_CASE_P(All, FrameViewSlimmingPaintV2Test, ::testing::Values(
- nullptr,
- &RootLayerScrollsFrameSettingOverride));
+INSTANTIATE_TEST_CASE_P(All, FrameViewTest, ::testing::Bool());
+INSTANTIATE_TEST_CASE_P(All, FrameViewSlimmingPaintV2Test, ::testing::Bool());
// These tests ensure that FrameView informs the ChromeClient of changes to the
// paint artifact so that they can be shown to the user (e.g. via the

Powered by Google App Engine
This is Rietveld 408576698