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

Unified Diff: third_party/WebKit/Source/core/paint/VideoPainterTest.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
Index: third_party/WebKit/Source/core/paint/VideoPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp b/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp
index 4462d15c227d4d74064907bcfaa73dadbc3a59b3..5087ce44a082d0612f4abb50fb2658cf710ddbab 100644
--- a/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp
@@ -10,6 +10,7 @@
#include "core/loader/EmptyClients.h"
#include "core/paint/StubChromeClientForSPv2.h"
#include "core/testing/DummyPageHolder.h"
+#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
#include "platform/testing/UnitTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebCompositorSupport.h"
@@ -89,10 +90,13 @@ class StubFrameLoaderClient : public EmptyFrameLoaderClient {
}
};
-class VideoPainterTestForSPv2 : public ::testing::Test {
+class VideoPainterTestForSPv2 : public ::testing::Test,
+ private ScopedSlimmingPaintV2ForTest {
+ public:
+ VideoPainterTestForSPv2() : ScopedSlimmingPaintV2ForTest(true) {}
+
protected:
void SetUp() override {
- RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
m_chromeClient = new StubChromeClientForSPv2();
m_frameLoaderClient = new StubFrameLoaderClient;
Page::PageClients clients;
@@ -108,15 +112,12 @@ class VideoPainterTestForSPv2 : public ::testing::Test {
document().setURL(KURL(KURL(), "https://example.com/"));
}
- void TearDown() override { m_featuresBackup.restore(); }
-
Document& document() { return m_pageHolder->document(); }
bool hasLayerAttached(const WebLayer& layer) {
return m_chromeClient->hasLayer(layer);
}
private:
- RuntimeEnabledFeatures::Backup m_featuresBackup;
Persistent<StubChromeClientForSPv2> m_chromeClient;
Persistent<StubFrameLoaderClient> m_frameLoaderClient;
std::unique_ptr<DummyPageHolder> m_pageHolder;

Powered by Google App Engine
This is Rietveld 408576698