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

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: Add RAII-style helper to toggle REF. Rebase. 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..e15bb7fcf1729633273776416de105cb8b6cefa3 100644
--- a/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/CompositorWorkerTest.cpp
@@ -10,6 +10,7 @@
#include "platform/graphics/CompositorMutableProperties.h"
#include "platform/graphics/CompositorMutation.h"
#include "platform/graphics/GraphicsLayer.h"
+#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "platform/testing/URLTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebLayer.h"
@@ -27,21 +28,21 @@
namespace blink {
+typedef bool TestParamRootLayerScrolling;
class CompositorWorkerTest
- : public testing::Test
- , public testing::WithParamInterface<FrameTestHelpers::SettingOverrideFunction>
- , public FrameTestHelpers::SettingOverrider {
+ : public testing::WithParamInterface<TestParamRootLayerScrolling>
+ , private ScopedRootLayerScrollingForTest
+ , private ScopedCompositorWorkerForTest
+ , public testing::Test {
public:
CompositorWorkerTest()
- : m_baseURL("http://www.test.com/")
- , m_helper(this)
- {
- }
+ : ScopedRootLayerScrollingForTest(GetParam())
+ , ScopedCompositorWorkerForTest(true)
+ , m_baseURL("http://www.test.com/") { }
void SetUp() override
{
- RuntimeEnabledFeatures::setCompositorWorkerEnabled(true);
m_helper.initialize(true, nullptr, &m_mockWebViewClient, nullptr, &configureSettings);
webViewImpl()->resize(IntSize(320, 240));
}
@@ -52,11 +53,6 @@ public:
WebCache::clear();
}
- void overrideSettings(WebSettings *settings) override
- {
- GetParam()(settings);
- }
-
void navigateTo(const String& url)
{
FrameTestHelpers::loadFrame(webViewImpl()->mainFrame(), url.utf8().data());
@@ -74,9 +70,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());
@@ -148,9 +142,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)
{
« no previous file with comments | « third_party/WebKit/Source/web/WebSettingsImpl.cpp ('k') | third_party/WebKit/Source/web/tests/FrameTestHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698