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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "blimp/common/blob_cache/id_util.h" | 10 #include "blimp/common/blob_cache/id_util.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 }; | 58 }; |
59 | 59 |
60 // Verifies compatibility between the sender and receiver, independent of | 60 // Verifies compatibility between the sender and receiver, independent of |
61 // transport-level implementation details. | 61 // transport-level implementation details. |
62 class BlobChannelIntegrationTest : public testing::Test { | 62 class BlobChannelIntegrationTest : public testing::Test { |
63 public: | 63 public: |
64 BlobChannelIntegrationTest() { | 64 BlobChannelIntegrationTest() { |
65 std::unique_ptr<SenderDelegateProxy> sender_delegate( | 65 std::unique_ptr<SenderDelegateProxy> sender_delegate( |
66 new SenderDelegateProxy); | 66 new SenderDelegateProxy); |
67 receiver_.reset( | 67 receiver_.reset( |
68 new BlobChannelReceiver(base::WrapUnique(new InMemoryBlobCache), | 68 new BlobChannelReceiverImpl(base::WrapUnique(new InMemoryBlobCache), |
69 sender_delegate->GetReceiverDelegate())); | 69 sender_delegate->GetReceiverDelegate())); |
70 sender_.reset(new BlobChannelSender(base::WrapUnique(new InMemoryBlobCache), | 70 sender_.reset(new BlobChannelSender(base::WrapUnique(new InMemoryBlobCache), |
71 std::move(sender_delegate))); | 71 std::move(sender_delegate))); |
72 } | 72 } |
73 | 73 |
74 ~BlobChannelIntegrationTest() override {} | 74 ~BlobChannelIntegrationTest() override {} |
75 | 75 |
76 protected: | 76 protected: |
77 std::unique_ptr<BlobChannelReceiver> receiver_; | 77 std::unique_ptr<BlobChannelReceiver> receiver_; |
78 std::unique_ptr<BlobChannelSender> sender_; | 78 std::unique_ptr<BlobChannelSender> sender_; |
79 base::MessageLoop message_loop_; | 79 base::MessageLoop message_loop_; |
(...skipping 11 matching lines...) Expand all Loading... |
91 | 91 |
92 EXPECT_EQ(nullptr, receiver_->Get(blob_id).get()); | 92 EXPECT_EQ(nullptr, receiver_->Get(blob_id).get()); |
93 sender_->DeliverBlob(blob_id); | 93 sender_->DeliverBlob(blob_id); |
94 | 94 |
95 base::RunLoop().RunUntilIdle(); | 95 base::RunLoop().RunUntilIdle(); |
96 EXPECT_EQ(kBlobPayload, receiver_->Get(blob_id)->data); | 96 EXPECT_EQ(kBlobPayload, receiver_->Get(blob_id)->data); |
97 } | 97 } |
98 | 98 |
99 } // namespace | 99 } // namespace |
100 } // namespace blimp | 100 } // namespace blimp |
OLD | NEW |