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

Side by Side Diff: blimp/net/blob_channel/blob_channel_receiver_unittest.cc

Issue 1970463004: Blimp: Add BlobChannel Helium messages and delegate impls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: haibinlu feedback Created 4 years, 7 months 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 unified diff | Download patch
OLDNEW
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 #include <string> 7 #include <string>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 23 matching lines...) Expand all
34 class NullBlobReceiverDelegate : public BlobChannelReceiver::Delegate { 34 class NullBlobReceiverDelegate : public BlobChannelReceiver::Delegate {
35 public: 35 public:
36 using BlobChannelReceiver::Delegate::OnBlobReceived; 36 using BlobChannelReceiver::Delegate::OnBlobReceived;
37 }; 37 };
38 38
39 class BlobChannelReceiverTest : public testing::Test { 39 class BlobChannelReceiverTest : public testing::Test {
40 public: 40 public:
41 BlobChannelReceiverTest() 41 BlobChannelReceiverTest()
42 : delegate_(new NullBlobReceiverDelegate), 42 : delegate_(new NullBlobReceiverDelegate),
43 cache_(new testing::StrictMock<MockBlobCache>), 43 cache_(new testing::StrictMock<MockBlobCache>),
44 blob_receiver_(new BlobChannelReceiver(base::WrapUnique(cache_), 44 blob_receiver_(new BlobChannelReceiverImpl(base::WrapUnique(cache_),
45 base::WrapUnique(delegate_))) 45 base::WrapUnique(delegate_)))
46 46
47 {} 47 {}
48 48
49 ~BlobChannelReceiverTest() override {} 49 ~BlobChannelReceiverTest() override {}
50 50
51 NullBlobReceiverDelegate* delegate_; 51 NullBlobReceiverDelegate* delegate_;
52 testing::StrictMock<MockBlobCache>* cache_; 52 testing::StrictMock<MockBlobCache>* cache_;
53 std::unique_ptr<BlobChannelReceiver> blob_receiver_; 53 std::unique_ptr<BlobChannelReceiver> blob_receiver_;
54 }; 54 };
55 55
(...skipping 23 matching lines...) Expand all
79 79
80 TEST_F(BlobChannelReceiverTest, GetUnknownBlob) { 80 TEST_F(BlobChannelReceiverTest, GetUnknownBlob) {
81 EXPECT_CALL(*cache_, Get(kBlobId)).WillOnce(Return(nullptr)); 81 EXPECT_CALL(*cache_, Get(kBlobId)).WillOnce(Return(nullptr));
82 auto result = blob_receiver_->Get(kBlobId); 82 auto result = blob_receiver_->Get(kBlobId);
83 83
84 ASSERT_EQ(nullptr, result.get()); 84 ASSERT_EQ(nullptr, result.get());
85 } 85 }
86 86
87 } // namespace 87 } // namespace
88 } // namespace blimp 88 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698