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

Unified Diff: third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp

Issue 2333133003: Make Surface creation lazy for OffscreenCanvasFrameReceiverImpl (Closed)
Patch Set: Rebase 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/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
index 6f98fdea9a40e35f42d2e5bc590351adb5ea2160..225354b8524538d69d4642863de43e1b1ecc1686 100644
--- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
@@ -10,7 +10,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/PtrUtil.h"
-#include "wtf/Vector.h"
#include <memory>
namespace blink {
@@ -18,15 +17,9 @@ namespace blink {
class FakeOffscreenCanvasSurfaceImpl {
public:
FakeOffscreenCanvasSurfaceImpl() {}
- ~FakeOffscreenCanvasSurfaceImpl();
+ ~FakeOffscreenCanvasSurfaceImpl() {}
bool GetSurfaceId(cc::SurfaceId*);
- void RequestSurfaceCreation(const cc::SurfaceId&);
-
- bool isSurfaceInSurfaceMap(const cc::SurfaceId&);
-
-private:
- Vector<cc::SurfaceId> m_fakeSurfaceMap;
};
//-----------------------------------------------------------------------------
@@ -37,7 +30,6 @@ public:
~MockCanvasSurfaceLayerBridgeClient() override;
bool syncGetSurfaceId(cc::SurfaceId*) override;
- void asyncRequestSurfaceCreation(const cc::SurfaceId&) override;
void asyncRequire(const cc::SurfaceId&, const cc::SurfaceSequence&) override {}
void asyncSatisfy(const cc::SurfaceSequence&) override {}
@@ -77,32 +69,12 @@ bool MockCanvasSurfaceLayerBridgeClient::syncGetSurfaceId(cc::SurfaceId* surface
return m_service->GetSurfaceId(surfaceIdPtr);
}
-void MockCanvasSurfaceLayerBridgeClient::asyncRequestSurfaceCreation(const cc::SurfaceId& surfaceId)
-{
- m_service->RequestSurfaceCreation(surfaceId);
-}
-
-FakeOffscreenCanvasSurfaceImpl::~FakeOffscreenCanvasSurfaceImpl()
-{
- m_fakeSurfaceMap.clear();
-}
-
bool FakeOffscreenCanvasSurfaceImpl::GetSurfaceId(cc::SurfaceId* surfaceId)
{
*surfaceId = cc::SurfaceId(10, 15, 0);
return true;
}
-void FakeOffscreenCanvasSurfaceImpl::RequestSurfaceCreation(const cc::SurfaceId& surfaceId)
-{
- m_fakeSurfaceMap.append(surfaceId);
-}
-
-bool FakeOffscreenCanvasSurfaceImpl::isSurfaceInSurfaceMap(const cc::SurfaceId& surfaceId)
-{
- return m_fakeSurfaceMap.contains(surfaceId);
-}
-
void CanvasSurfaceLayerBridgeTest::SetUp()
{
m_surfaceService = wrapUnique(new FakeOffscreenCanvasSurfaceImpl());
@@ -113,7 +85,6 @@ void CanvasSurfaceLayerBridgeTest::SetUp()
TEST_F(CanvasSurfaceLayerBridgeTest, SurfaceLayerCreation)
{
bool success = this->surfaceLayerBridge()->createSurfaceLayer(50, 50);
- EXPECT_TRUE(this->surfaceService()->isSurfaceInSurfaceMap(this->surfaceLayerBridge()->getSurfaceId()));
EXPECT_TRUE(success);
}

Powered by Google App Engine
This is Rietveld 408576698