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

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

Issue 2584643002: Revamp OffscreenCanvas commit flow (Closed)
Patch Set: more fix 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/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp b/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
deleted file mode 100644
index a7e46617d2cb5660e9c26aec37e69d317afa4c12..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/graphics/CanvasSurfaceLayerBridgeTest.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2016 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 "platform/graphics/CanvasSurfaceLayerBridge.h"
-
-#include "cc/surfaces/surface_id.h"
-#include "cc/surfaces/surface_sequence.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "mojo/public/cpp/bindings/interface_request.h"
-#include "public/platform/modules/offscreencanvas/offscreen_canvas_surface.mojom-blink.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "wtf/PtrUtil.h"
-#include <memory>
-#include <utility>
-
-namespace blink {
-
-//-----------------------------------------------------------------------------
-
-class MockOffscreenCanvasSurface final
- : public mojom::blink::OffscreenCanvasSurface {
- public:
- MockOffscreenCanvasSurface();
- ~MockOffscreenCanvasSurface() override;
-
- mojom::blink::OffscreenCanvasSurfacePtr GetProxy();
-
- void GetSurfaceId(GetSurfaceIdCallback) override;
- void Require(const cc::SurfaceId&, const cc::SurfaceSequence&) override {}
- void Satisfy(const cc::SurfaceSequence&) override {}
-
- private:
- mojo::Binding<mojom::blink::OffscreenCanvasSurface> m_binding;
- cc::SurfaceId m_surfaceId;
-};
-
-//-----------------------------------------------------------------------------
-
-class CanvasSurfaceLayerBridgeTest : public testing::Test {
- public:
- CanvasSurfaceLayerBridge* surfaceLayerBridge() const {
- return m_surfaceLayerBridge.get();
- }
-
- protected:
- void SetUp() override;
-
- private:
- MockOffscreenCanvasSurface m_service;
- std::unique_ptr<CanvasSurfaceLayerBridge> m_surfaceLayerBridge;
-};
-
-//-----------------------------------------------------------------------------
-
-MockOffscreenCanvasSurface::MockOffscreenCanvasSurface() : m_binding(this) {}
-
-MockOffscreenCanvasSurface::~MockOffscreenCanvasSurface() {}
-
-mojom::blink::OffscreenCanvasSurfacePtr MockOffscreenCanvasSurface::GetProxy() {
- return m_binding.CreateInterfacePtrAndBind();
-}
-
-void MockOffscreenCanvasSurface::GetSurfaceId(GetSurfaceIdCallback callback) {
- std::move(callback).Run(
- cc::SurfaceId(cc::FrameSinkId(10, 11),
- cc::LocalFrameId(15, base::UnguessableToken::Create())));
-}
-
-void CanvasSurfaceLayerBridgeTest::SetUp() {
- m_surfaceLayerBridge =
- WTF::wrapUnique(new CanvasSurfaceLayerBridge(m_service.GetProxy()));
-}
-
-TEST_F(CanvasSurfaceLayerBridgeTest, SurfaceLayerCreation) {
- bool success = this->surfaceLayerBridge()->createSurfaceLayer(50, 50);
- EXPECT_TRUE(success);
-}
-
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698