| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <memory> |
| 6 |
| 7 #include "blimp/client/core/compositor/blob_image_serialization_processor.h" |
| 8 #include "blimp/client/core/compositor/blob_manager.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 using testing::_; |
| 13 |
| 14 namespace blimp { |
| 15 namespace client { |
| 16 |
| 17 class MockImageDecodeErrorDelegate |
| 18 : public BlobImageSerializationProcessor::ErrorDelegate { |
| 19 MOCK_METHOD0(OnImageDecodeError, void()); |
| 20 }; |
| 21 |
| 22 class MockBlobManager : public BlobManager { |
| 23 public: |
| 24 MockBlobManager() : BlobManager(&mock_delegate) {} |
| 25 ~MockBlobManager() override {} |
| 26 |
| 27 BlobChannelReceiver* Receiver() { return blob_receiver_.get(); } |
| 28 |
| 29 private: |
| 30 MockImageDecodeErrorDelegate mock_delegate; |
| 31 }; |
| 32 |
| 33 class BlobManagerTest : public testing::Test { |
| 34 public: |
| 35 BlobManagerTest() {} |
| 36 ~BlobManagerTest() override {} |
| 37 |
| 38 private: |
| 39 DISALLOW_COPY_AND_ASSIGN(BlobManagerTest); |
| 40 }; |
| 41 |
| 42 TEST_F(BlobManagerTest, CheckReceiver) { |
| 43 MockBlobManager blob_manager; |
| 44 // BlobManager wrapper must have the receiver. |
| 45 DCHECK(blob_manager.Receiver()); |
| 46 } |
| 47 |
| 48 } // namespace client |
| 49 } // namespace blimp |
| OLD | NEW |