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

Side by Side Diff: services/shell/tests/connect/connect_unittest.cc

Issue 2259823003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 std::unique_ptr<Connection> connection = 128 std::unique_ptr<Connection> connection =
129 connector()->Connect(kTestPackageName); 129 connector()->Connect(kTestPackageName);
130 connection->GetInterface(&root_service); 130 connection->GetInterface(&root_service);
131 base::RunLoop run_loop; 131 base::RunLoop run_loop;
132 std::string root_name; 132 std::string root_name;
133 root_service->GetTitle( 133 root_service->GetTitle(
134 base::Bind(&ReceiveOneString, &root_name, &run_loop)); 134 base::Bind(&ReceiveOneString, &root_name, &run_loop));
135 run_loop.Run(); 135 run_loop.Run();
136 } 136 }
137 std::unique_ptr<Service> CreateService() override { 137 std::unique_ptr<Service> CreateService() override {
138 return base::WrapUnique(new TestService(this)); 138 return base::MakeUnique<TestService>(this);
139 } 139 }
140 140
141 // InterfaceFactory<test::mojom::ExposedInterface>: 141 // InterfaceFactory<test::mojom::ExposedInterface>:
142 void Create(const Identity& remote_identity, 142 void Create(const Identity& remote_identity,
143 test::mojom::ExposedInterfaceRequest request) override { 143 test::mojom::ExposedInterfaceRequest request) override {
144 bindings_.AddBinding(this, std::move(request)); 144 bindings_.AddBinding(this, std::move(request));
145 } 145 }
146 146
147 void ConnectionAccepted(test::mojom::ConnectionStatePtr state) override { 147 void ConnectionAccepted(test::mojom::ConnectionStatePtr state) override {
148 connection_state_ = std::move(state); 148 connection_state_ = std::move(state);
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 base::RunLoop loop; 406 base::RunLoop loop;
407 inherit_connection->AddConnectionCompletedClosure( 407 inherit_connection->AddConnectionCompletedClosure(
408 base::Bind(&QuitLoop, &loop)); 408 base::Bind(&QuitLoop, &loop));
409 loop.Run(); 409 loop.Run();
410 EXPECT_EQ(inherit_connection->GetRemoteIdentity().user_id(), 410 EXPECT_EQ(inherit_connection->GetRemoteIdentity().user_id(),
411 connection->GetRemoteIdentity().user_id()); 411 connection->GetRemoteIdentity().user_id());
412 } 412 }
413 } 413 }
414 414
415 } // namespace shell 415 } // namespace shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698