| Index: third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
|
| diff --git a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
|
| index 66312aa1dffc2bb7178b30c15ba06a7d74e310ca..b669df1c2648561fb104c074f27f39398c052f86 100644
|
| --- a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
|
| +++ b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
|
| @@ -27,21 +27,24 @@
|
|
|
| namespace blink {
|
|
|
| +typedef bool TestParamRootLayerScrolling;
|
| class CompositorWorkerTest
|
| : public testing::Test
|
| - , public testing::WithParamInterface<FrameTestHelpers::SettingOverrideFunction>
|
| - , public FrameTestHelpers::SettingOverrider {
|
| + , public testing::WithParamInterface<TestParamRootLayerScrolling> {
|
|
|
| public:
|
| CompositorWorkerTest()
|
| - : m_baseURL("http://www.test.com/")
|
| - , m_helper(this)
|
| + : m_originalRootLayerScrollingEnabled(RuntimeEnabledFeatures::rootLayerScrollingEnabled())
|
| + , m_enableRootLayerScrolling(GetParam())
|
| + , m_originalCompositorWorkerEnabled(RuntimeEnabledFeatures::compositorWorkerEnabled())
|
| + , m_baseURL("http://www.test.com/")
|
| {
|
| + RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_enableRootLayerScrolling);
|
| + RuntimeEnabledFeatures::setCompositorWorkerEnabled(true);
|
| }
|
|
|
| void SetUp() override
|
| {
|
| - RuntimeEnabledFeatures::setCompositorWorkerEnabled(true);
|
| m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr, &configureSettings);
|
| webViewImpl()->resize(IntSize(320, 240));
|
| }
|
| @@ -50,11 +53,11 @@ public:
|
| {
|
| Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs();
|
| WebCache::clear();
|
| - }
|
|
|
| - void overrideSettings(WebSettings *settings) override
|
| - {
|
| - GetParam()(settings);
|
| + CHECK_EQ(m_enableRootLayerScrolling, RuntimeEnabledFeatures::rootLayerScrollingEnabled());
|
| + CHECK_EQ(true, RuntimeEnabledFeatures::compositorWorkerEnabled());
|
| + RuntimeEnabledFeatures::setCompositorWorkerEnabled(m_originalCompositorWorkerEnabled);
|
| + RuntimeEnabledFeatures::setRootLayerScrollingEnabled(m_originalRootLayerScrollingEnabled);
|
| }
|
|
|
| void navigateTo(const String& url)
|
| @@ -74,9 +77,7 @@ public:
|
|
|
| WebLayer* getRootScrollLayer()
|
| {
|
| - Settings* settings = frame()->settings();
|
| - bool rootLayerScrolls = settings && settings->rootLayerScrolls();
|
| - if (rootLayerScrolls) {
|
| + if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| DCHECK(frame());
|
| DCHECK(frame()->view());
|
| DCHECK(frame()->view()->layoutViewportScrollableArea());
|
| @@ -94,6 +95,11 @@ public:
|
| WebViewImpl* webViewImpl() const { return m_helper.webView(); }
|
| LocalFrame* frame() const { return m_helper.webView()->mainFrameImpl()->frame(); }
|
|
|
| +private:
|
| + bool m_originalRootLayerScrollingEnabled;
|
| + bool m_enableRootLayerScrolling;
|
| + bool m_originalCompositorWorkerEnabled;
|
| +
|
| protected:
|
| String m_baseURL;
|
| FrameTestHelpers::TestWebViewClient m_mockWebViewClient;
|
| @@ -148,9 +154,7 @@ static WebLayer* webLayerFromElement(Element* element)
|
| return webLayerFromGraphicsLayer(compositedLayerMapping->mainGraphicsLayer());
|
| }
|
|
|
| -INSTANTIATE_TEST_CASE_P(All, CompositorWorkerTest, ::testing::Values(
|
| - FrameTestHelpers::DefaultSettingOverride,
|
| - FrameTestHelpers::RootLayerScrollsSettingOverride));
|
| +INSTANTIATE_TEST_CASE_P(All, CompositorWorkerTest, ::testing::Bool());
|
|
|
| TEST_P(CompositorWorkerTest, plumbingElementIdAndMutableProperties)
|
| {
|
|
|