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. |