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

Unified Diff: third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp

Issue 2582903002: Use scoped REF test helpers for SPv2 and RootLayerScrolls. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/VideoPainterTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp b/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
index fcd1fb43d45bf51c992345a95ac476d8c1aa90f5..6e55a791e58ee248a0999075a1dccf7cf12f6a2b 100644
--- a/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
@@ -16,6 +16,7 @@
#include "platform/graphics/Canvas2DLayerBridge.h"
#include "platform/graphics/test/FakeGLES2Interface.h"
#include "platform/graphics/test/FakeWebGraphicsContext3DProvider.h"
+#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "public/platform/WebLayer.h"
#include "public/platform/WebSize.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -25,11 +26,16 @@
namespace blink {
class HTMLCanvasPainterTestForSPv2 : public ::testing::Test,
- public testing::WithParamInterface<bool> {
+ public testing::WithParamInterface<bool>,
+ private ScopedSlimmingPaintV2ForTest,
+ private ScopedRootLayerScrollingForTest {
+ public:
+ HTMLCanvasPainterTestForSPv2()
+ : ScopedSlimmingPaintV2ForTest(true),
+ ScopedRootLayerScrollingForTest(GetParam()) {}
+
protected:
void SetUp() override {
- RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
- RuntimeEnabledFeatures::setRootLayerScrollingEnabled(GetParam());
m_chromeClient = new StubChromeClientForSPv2();
Page::PageClients clients;
fillWithEmptyClients(clients);
@@ -44,8 +50,6 @@ class HTMLCanvasPainterTestForSPv2 : public ::testing::Test,
document().view()->setSelfVisible(true);
}
- void TearDown() override { m_featuresBackup.restore(); }
-
Document& document() { return m_pageHolder->document(); }
bool hasLayerAttached(const WebLayer& layer) {
return m_chromeClient->hasLayer(layer);
@@ -59,7 +63,6 @@ class HTMLCanvasPainterTestForSPv2 : public ::testing::Test,
}
private:
- RuntimeEnabledFeatures::Backup m_featuresBackup;
Persistent<StubChromeClientForSPv2> m_chromeClient;
FakeGLES2Interface m_gl;
std::unique_ptr<DummyPageHolder> m_pageHolder;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/VideoPainterTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698