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

Unified Diff: third_party/WebKit/Source/web/tests/VisualViewportTest.cpp

Issue 2258523006: Convert Settings::rootLayerScrolls to RuntimeEnabledFeatures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/web/tests/VisualViewportTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
index f1c9c5af3715ee4b3129d7a06c335e39705a79d0..9edb5c61d896ed12dec74c10b53d0d8a63001919 100644
--- a/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/web/tests/VisualViewportTest.cpp
@@ -102,16 +102,10 @@ namespace blink {
namespace {
class VisualViewportTest
- : public testing::Test
- , public FrameTestHelpers::SettingOverrider {
+ : public testing::Test {
public:
VisualViewportTest()
: m_baseURL("http://www.test.com/")
- , m_helper(this)
- {
- }
-
- void overrideSettings(WebSettings *settings) override
{
}
@@ -188,19 +182,30 @@ private:
FrameTestHelpers::WebViewHelper m_helper;
};
+typedef bool TestParamRootLayerScrolling;
class ParameterizedVisualViewportTest
: public VisualViewportTest
- , public testing::WithParamInterface<FrameTestHelpers::SettingOverrideFunction> {
+ , public testing::WithParamInterface<TestParamRootLayerScrolling> {
public:
- void overrideSettings(WebSettings *settings) override
+ ParameterizedVisualViewportTest()
+ : m_originalRootLayerScrollingEnabled(RuntimeEnabledFeatures::rootLayerScrollingEnabled())
+ , m_enableRootLayerScrolling(GetParam())
+ {
+ RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_enableRootLayerScrolling);
+ }
+
+ ~ParameterizedVisualViewportTest()
{
- GetParam()(settings);
+ CHECK_EQ(m_enableRootLayerScrolling, RuntimeEnabledFeatures::rootLayerScrollingEnabled());
+ RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_originalRootLayerScrollingEnabled);
}
+
+private:
+ bool m_originalRootLayerScrollingEnabled;
+ bool m_enableRootLayerScrolling;
};
-INSTANTIATE_TEST_CASE_P(All, ParameterizedVisualViewportTest, ::testing::Values(
- FrameTestHelpers::DefaultSettingOverride,
- FrameTestHelpers::RootLayerScrollsSettingOverride));
+INSTANTIATE_TEST_CASE_P(All, ParameterizedVisualViewportTest, ::testing::Bool());
// Test that resizing the VisualViewport works as expected and that resizing the
// WebView resizes the VisualViewport.

Powered by Google App Engine
This is Rietveld 408576698