| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <memory> | 6 #include <memory> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "blimp/common/blob_cache/mock_blob_cache.h" | 9 #include "blimp/common/blob_cache/mock_blob_cache.h" |
| 10 #include "blimp/net/blob_channel/blob_channel_sender.h" | 10 #include "blimp/net/blob_channel/blob_channel_sender.h" |
| 11 #include "blimp/net/blob_channel/mock_blob_channel_bindings.h" | 11 #include "blimp/net/blob_channel/mock_blob_channel_bindings.h" |
| 12 #include "testing/gmock/include/gmock/gmock.h" | 12 #include "testing/gmock/include/gmock/gmock.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace blimp { | 15 namespace blimp { |
| 16 namespace engine { | |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 using testing::Pointee; | 18 using testing::Pointee; |
| 20 using testing::Return; | 19 using testing::Return; |
| 21 | 20 |
| 22 const char kBlobId[] = "blob-1"; | 21 const char kBlobId[] = "blob-1"; |
| 23 const char kBlobPayload[] = "blob-1-payload"; | 22 const char kBlobPayload[] = "blob-1-payload"; |
| 24 | 23 |
| 25 // Helper function for creating a cache payload vector from a string. | 24 // Helper function for creating a cache payload vector from a string. |
| 26 scoped_refptr<RefCountedVector> CreatePayload(const std::string& input) { | 25 scoped_refptr<RefCountedVector> CreatePayload(const std::string& input) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 base::WrapUnique(new std::vector<uint8_t>(StringToVector(kBlobPayload)))); | 88 base::WrapUnique(new std::vector<uint8_t>(StringToVector(kBlobPayload)))); |
| 90 blob_sender_.Push(kBlobId); | 89 blob_sender_.Push(kBlobId); |
| 91 } | 90 } |
| 92 | 91 |
| 93 TEST_F(BlobChannelSenderTest, TestPushUnknownBlobId) { | 92 TEST_F(BlobChannelSenderTest, TestPushUnknownBlobId) { |
| 94 EXPECT_CALL(mock_cache_, Contains(kBlobId)).WillOnce(Return(false)); | 93 EXPECT_CALL(mock_cache_, Contains(kBlobId)).WillOnce(Return(false)); |
| 95 blob_sender_.Push(kBlobId); | 94 blob_sender_.Push(kBlobId); |
| 96 } | 95 } |
| 97 | 96 |
| 98 } // namespace | 97 } // namespace |
| 99 } // namespace engine | |
| 100 } // namespace blimp | 98 } // namespace blimp |
| OLD | NEW |