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

Side by Side Diff: services/service_manager/public/cpp/lib/service_test.cc

Issue 2804373002: Eliminate Connector::Connect(), Connection, etc. (Closed)
Patch Set: . Created 3 years, 8 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 "services/service_manager/public/cpp/service_test.h" 5 #include "services/service_manager/public/cpp/service_test.h"
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 "base/threading/thread.h" 10 #include "base/threading/thread.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "mojo/edk/embedder/embedder.h" 12 #include "mojo/edk/embedder/embedder.h"
13 #include "mojo/edk/embedder/scoped_ipc_support.h" 13 #include "mojo/edk/embedder/scoped_ipc_support.h"
14 #include "services/service_manager/background/background_service_manager.h" 14 #include "services/service_manager/background/background_service_manager.h"
15 #include "services/service_manager/public/cpp/service.h" 15 #include "services/service_manager/public/cpp/service.h"
16 #include "services/service_manager/public/cpp/service_context.h" 16 #include "services/service_manager/public/cpp/service_context.h"
17 17
18 namespace service_manager { 18 namespace service_manager {
19 namespace test { 19 namespace test {
20 20
21 ServiceTestClient::ServiceTestClient(ServiceTest* test) : test_(test) {} 21 ServiceTestClient::ServiceTestClient(ServiceTest* test) : test_(test) {}
22 22
23 ServiceTestClient::~ServiceTestClient() {} 23 ServiceTestClient::~ServiceTestClient() {}
24 24
25 void ServiceTestClient::OnStart() { 25 void ServiceTestClient::OnStart() {
26 test_->OnStartCalled(context()->connector(), context()->identity().name(), 26 test_->OnStartCalled(context()->connector(), context()->identity().name(),
27 context()->identity().user_id()); 27 context()->identity().user_id());
28 } 28 }
29 29
30 bool ServiceTestClient::OnConnect(const ServiceInfo& remote_info, 30 void ServiceTestClient::OnBindInterface(
31 InterfaceRegistry* registry) { 31 const ServiceInfo& source_info,
32 return false; 32 const std::string& interface_name,
33 } 33 mojo::ScopedMessagePipeHandle interface_pipe) {}
34
35 34
36 ServiceTest::ServiceTest() {} 35 ServiceTest::ServiceTest() {}
37 36
38 ServiceTest::ServiceTest(const std::string& test_name, bool init_edk) 37 ServiceTest::ServiceTest(const std::string& test_name, bool init_edk)
39 : test_name_(test_name), init_edk_(init_edk) {} 38 : test_name_(test_name), init_edk_(init_edk) {}
40 39
41 ServiceTest::~ServiceTest() {} 40 ServiceTest::~ServiceTest() {}
42 41
43 void ServiceTest::InitTestName(const std::string& test_name) { 42 void ServiceTest::InitTestName(const std::string& test_name) {
44 DCHECK(test_name_.empty()); 43 DCHECK(test_name_.empty());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 87 }
89 88
90 void ServiceTest::TearDown() { 89 void ServiceTest::TearDown() {
91 background_service_manager_.reset(); 90 background_service_manager_.reset();
92 context_.reset(); 91 context_.reset();
93 message_loop_.reset(); 92 message_loop_.reset();
94 } 93 }
95 94
96 } // namespace test 95 } // namespace test
97 } // namespace service_manager 96 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/service_manager/public/cpp/lib/service_context.cc ('k') | services/service_manager/public/cpp/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698