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

Unified Diff: third_party/WebKit/Source/web/WebViewImplPaintArtifactCompositorTest.cpp

Issue 2342103002: Refactor the way PaintArtifactCompositor is attached and used. (Closed)
Patch Set: none Created 4 years, 3 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/WebViewImplPaintArtifactCompositorTest.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImplPaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/web/WebViewImplPaintArtifactCompositorTest.cpp
deleted file mode 100644
index 6a4a7dbf07e794f54b5e6ad40cf5037319763f4c..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/web/WebViewImplPaintArtifactCompositorTest.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "web/WebViewImpl.h"
-
-#include "platform/RuntimeEnabledFeatures.h"
-#include "platform/graphics/compositing/PaintArtifactCompositor.h"
-#include "public/platform/WebLayerTreeView.h"
-#include "public/web/WebViewClient.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "web/tests/FrameTestHelpers.h"
-
-// Tests that WebViewImpl attaches the layer owned by PaintArtifactCompositor to
-// the WebLayerTreeView when requested.
-
-using testing::Property;
-
-namespace blink {
-namespace {
-
-class MockWebLayerTreeView : public WebLayerTreeView {
-public:
- // WebLayerTreeView
- MOCK_METHOD1(setRootLayer, void(const WebLayer&));
- MOCK_METHOD0(clearRootLayer, void());
-};
-
-class TestWebViewClientWithLayerTreeView : public FrameTestHelpers::TestWebViewClient {
-public:
- TestWebViewClientWithLayerTreeView(WebLayerTreeView* layerTreeView)
- : m_layerTreeView(layerTreeView) { }
-
- // WebViewClient
- WebLayerTreeView* layerTreeView() override { return m_layerTreeView; }
-
-private:
- WebLayerTreeView* m_layerTreeView;
-};
-
-class WebViewImplPaintArtifactCompositorTest : public testing::Test {
-protected:
- WebViewImplPaintArtifactCompositorTest()
- : m_webViewClient(&m_webLayerTreeView) { }
-
- void SetUp() override
- {
- RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
- m_helper.initialize(false, nullptr, &m_webViewClient);
- }
-
- void TearDown() override
- {
- m_featuresBackup.restore();
- }
-
- MockWebLayerTreeView& webLayerTreeView() { return m_webLayerTreeView; }
- WebViewImpl& webViewImpl() { return *m_helper.webView(); }
- PaintArtifactCompositor& getPaintArtifactCompositor() { return webViewImpl().getPaintArtifactCompositor(); }
-
-private:
- RuntimeEnabledFeatures::Backup m_featuresBackup;
- MockWebLayerTreeView m_webLayerTreeView;
- TestWebViewClientWithLayerTreeView m_webViewClient;
- FrameTestHelpers::WebViewHelper m_helper;
-};
-
-TEST_F(WebViewImplPaintArtifactCompositorTest, AttachAndDetach)
-{
- cc::Layer* rootLayer = getPaintArtifactCompositor().rootLayer();
- ASSERT_TRUE(rootLayer);
-
- EXPECT_CALL(webLayerTreeView(), setRootLayer(Property(&WebLayer::ccLayer, rootLayer)));
- webViewImpl().attachPaintArtifactCompositor();
- testing::Mock::VerifyAndClearExpectations(&webLayerTreeView());
-
- EXPECT_CALL(webLayerTreeView(), clearRootLayer());
- webViewImpl().detachPaintArtifactCompositor();
- testing::Mock::VerifyAndClearExpectations(&webLayerTreeView());
-}
-
-} // namespace
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698