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

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: 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/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 88f794aa9a9c7c3e09b3def79a19a2dd8bcde06d..9dffa5d5d115b80ccc9f4c1059cfc4b110f5b641 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;
esprehn 2016/08/25 23:59:24 again
};
-INSTANTIATE_TEST_CASE_P(All, ParameterizedVisualViewportTest, ::testing::Values(
- FrameTestHelpers::DefaultSettingOverride,
- FrameTestHelpers::RootLayerScrollsSettingOverride));
esprehn 2016/08/25 23:59:24 this doesn't seem better to copy pasta this all ov
+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