Chromium Code Reviews| 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..738fdfb6316ebc16334aefd51df5a5c1feac3bbb 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,11 @@ 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()); |
| + } |
| + |
| + void TearDown() override |
| + { |
| + RuntimeEnabledFeatures::setRootLayerScrollingEnabled(GetParam()); |
|
skobes
2016/08/21 14:21:21
Why is this in TearDown?
trchen
2016/08/24 01:01:55
Whoops, probably a mis-paste. Deleted.
|
| } |
| Document& document() { return m_pageHolder->document(); } |
| @@ -68,6 +78,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 +116,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 |