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

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

Issue 2250433006: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 <memory> 5 #include <memory>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 EXPECT_CALL(*receiver_delegate, SetReceiver(_)) 64 EXPECT_CALL(*receiver_delegate, SetReceiver(_))
65 .WillOnce(SaveArg<0>(&stored_receiver)); 65 .WillOnce(SaveArg<0>(&stored_receiver));
66 66
67 receiver_ = BlobChannelReceiver::Create( 67 receiver_ = BlobChannelReceiver::Create(
68 base::WrapUnique(new InMemoryBlobCache), std::move(receiver_delegate)); 68 base::WrapUnique(new InMemoryBlobCache), std::move(receiver_delegate));
69 69
70 EXPECT_EQ(receiver_.get(), stored_receiver); 70 EXPECT_EQ(receiver_.get(), stored_receiver);
71 71
72 sender_.reset(new BlobChannelSenderImpl( 72 sender_.reset(new BlobChannelSenderImpl(
73 base::WrapUnique(new InMemoryBlobCache), 73 base::WrapUnique(new InMemoryBlobCache),
74 base::WrapUnique(new SenderDelegateProxy(receiver_.get())))); 74 base::MakeUnique<SenderDelegateProxy>(receiver_.get())));
75 } 75 }
76 76
77 ~BlobChannelIntegrationTest() override {} 77 ~BlobChannelIntegrationTest() override {}
78 78
79 protected: 79 protected:
80 MockBlobChannelReceiverDelegate* receiver_delegate_; 80 MockBlobChannelReceiverDelegate* receiver_delegate_;
81 std::unique_ptr<BlobChannelReceiver> receiver_; 81 std::unique_ptr<BlobChannelReceiver> receiver_;
82 std::unique_ptr<BlobChannelSender> sender_; 82 std::unique_ptr<BlobChannelSender> sender_;
83 base::MessageLoop message_loop_; 83 base::MessageLoop message_loop_;
84 84
(...skipping 10 matching lines...) Expand all
95 95
96 EXPECT_EQ(nullptr, receiver_->Get(blob_id).get()); 96 EXPECT_EQ(nullptr, receiver_->Get(blob_id).get());
97 sender_->DeliverBlob(blob_id); 97 sender_->DeliverBlob(blob_id);
98 98
99 base::RunLoop().RunUntilIdle(); 99 base::RunLoop().RunUntilIdle();
100 EXPECT_EQ(kBlobPayload, receiver_->Get(blob_id)->data); 100 EXPECT_EQ(kBlobPayload, receiver_->Get(blob_id)->data);
101 } 101 }
102 102
103 } // namespace 103 } // namespace
104 } // namespace blimp 104 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/blimp_message_thread_pipe_unittest.cc ('k') | blimp/net/engine_connection_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698