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

Side by Side Diff: blimp/net/engine_connection_manager_unittest.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, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/net/engine_connection_manager.h" 5 #include "blimp/net/engine_connection_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 21 matching lines...) Expand all
32 namespace blimp { 32 namespace blimp {
33 33
34 class EngineConnectionManagerTest : public testing::Test { 34 class EngineConnectionManagerTest : public testing::Test {
35 public: 35 public:
36 EngineConnectionManagerTest() 36 EngineConnectionManagerTest()
37 : manager_(new EngineConnectionManager(&connection_handler_)) {} 37 : manager_(new EngineConnectionManager(&connection_handler_)) {}
38 38
39 ~EngineConnectionManagerTest() override {} 39 ~EngineConnectionManagerTest() override {}
40 40
41 std::unique_ptr<BlimpConnection> CreateConnection() { 41 std::unique_ptr<BlimpConnection> CreateConnection() {
42 return base::WrapUnique( 42 return base::MakeUnique<BlimpConnection>(
43 new BlimpConnection(base::WrapUnique(new MockPacketReader), 43 base::WrapUnique(new MockPacketReader),
44 base::WrapUnique(new MockPacketWriter))); 44 base::WrapUnique(new MockPacketWriter));
45 } 45 }
46 46
47 protected: 47 protected:
48 base::MessageLoopForIO message_loop_; 48 base::MessageLoopForIO message_loop_;
49 testing::StrictMock<MockConnectionHandler> connection_handler_; 49 testing::StrictMock<MockConnectionHandler> connection_handler_;
50 std::unique_ptr<EngineConnectionManager> manager_; 50 std::unique_ptr<EngineConnectionManager> manager_;
51 }; 51 };
52 52
53 TEST_F(EngineConnectionManagerTest, ConnectionSucceeds) { 53 TEST_F(EngineConnectionManagerTest, ConnectionSucceeds) {
54 std::unique_ptr<testing::StrictMock<MockTransport>> transport1( 54 std::unique_ptr<testing::StrictMock<MockTransport>> transport1(
(...skipping 27 matching lines...) Expand all
82 manager_->AddTransport(std::move(transport2)); 82 manager_->AddTransport(std::move(transport2));
83 ASSERT_FALSE(connect_cb_2.is_null()); 83 ASSERT_FALSE(connect_cb_2.is_null());
84 84
85 base::ResetAndReturn(&connect_cb_1).Run(net::OK); 85 base::ResetAndReturn(&connect_cb_1).Run(net::OK);
86 base::ResetAndReturn(&connect_cb_2).Run(net::OK); 86 base::ResetAndReturn(&connect_cb_2).Run(net::OK);
87 ASSERT_FALSE(connect_cb_1.is_null()); 87 ASSERT_FALSE(connect_cb_1.is_null());
88 ASSERT_FALSE(connect_cb_2.is_null()); 88 ASSERT_FALSE(connect_cb_2.is_null());
89 } 89 }
90 90
91 } // namespace blimp 91 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/blob_channel/blob_channel_integration_test.cc ('k') | blimp/net/tcp_engine_transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698