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

Unified Diff: third_party/WebKit/Source/web/tests/CompositorWorkerTest.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/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);
esprehn 2016/08/25 23:59:24 more manual?
}
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)
{

Powered by Google App Engine
This is Rietveld 408576698