| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/CanvasSurfaceLayerBridge.h" | 5 #include "platform/graphics/CanvasSurfaceLayerBridge.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/surface_id.h" | 7 #include "cc/surfaces/surface_id.h" |
| 8 #include "cc/surfaces/surface_sequence.h" | 8 #include "cc/surfaces/surface_sequence.h" |
| 9 #include "platform/graphics/CanvasSurfaceLayerBridgeClient.h" | 9 #include "platform/graphics/CanvasSurfaceLayerBridgeClient.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 //----------------------------------------------------------------------------- | 32 //----------------------------------------------------------------------------- |
| 33 | 33 |
| 34 class MockCanvasSurfaceLayerBridgeClient final : public CanvasSurfaceLayerBridge
Client { | 34 class MockCanvasSurfaceLayerBridgeClient final : public CanvasSurfaceLayerBridge
Client { |
| 35 public: | 35 public: |
| 36 explicit MockCanvasSurfaceLayerBridgeClient(FakeOffscreenCanvasSurfaceImpl*)
; | 36 explicit MockCanvasSurfaceLayerBridgeClient(FakeOffscreenCanvasSurfaceImpl*)
; |
| 37 ~MockCanvasSurfaceLayerBridgeClient() override; | 37 ~MockCanvasSurfaceLayerBridgeClient() override; |
| 38 | 38 |
| 39 bool syncGetSurfaceId(cc::SurfaceId*) override; | 39 bool syncGetSurfaceId(cc::SurfaceId*) override; |
| 40 void asyncRequestSurfaceCreation(const cc::SurfaceId&) override; | 40 void asyncRequestSurfaceCreation(const cc::SurfaceId&) override; |
| 41 void asyncRequire(cc::SurfaceId, cc::SurfaceSequence) override {} | 41 void asyncRequire(const cc::SurfaceId&, const cc::SurfaceSequence&) override
{} |
| 42 void asyncSatisfy(cc::SurfaceSequence) override {}; | 42 void asyncSatisfy(const cc::SurfaceSequence&) override {} |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 FakeOffscreenCanvasSurfaceImpl* m_service; | 45 FakeOffscreenCanvasSurfaceImpl* m_service; |
| 46 cc::SurfaceId m_surfaceId; | 46 cc::SurfaceId m_surfaceId; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 //----------------------------------------------------------------------------- | 49 //----------------------------------------------------------------------------- |
| 50 | 50 |
| 51 class CanvasSurfaceLayerBridgeTest : public testing::Test { | 51 class CanvasSurfaceLayerBridgeTest : public testing::Test { |
| 52 public: | 52 public: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 | 112 |
| 113 TEST_F(CanvasSurfaceLayerBridgeTest, SurfaceLayerCreation) | 113 TEST_F(CanvasSurfaceLayerBridgeTest, SurfaceLayerCreation) |
| 114 { | 114 { |
| 115 bool success = this->surfaceLayerBridge()->createSurfaceLayer(50, 50); | 115 bool success = this->surfaceLayerBridge()->createSurfaceLayer(50, 50); |
| 116 EXPECT_TRUE(this->surfaceService()->isSurfaceInSurfaceMap(this->surfaceLayer
Bridge()->getSurfaceId())); | 116 EXPECT_TRUE(this->surfaceService()->isSurfaceInSurfaceMap(this->surfaceLayer
Bridge()->getSurfaceId())); |
| 117 EXPECT_TRUE(success); | 117 EXPECT_TRUE(success); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |