| OLD | NEW |
| 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 "services/service_manager/background/background_service_manager.h" | 10 #include "services/service_manager/background/background_service_manager.h" |
| 11 #include "services/service_manager/public/cpp/service.h" | 11 #include "services/service_manager/public/cpp/service.h" |
| 12 | 12 |
| 13 namespace service_manager { | 13 namespace service_manager { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 ServiceTestClient::ServiceTestClient(ServiceTest* test) : test_(test) {} | 16 ServiceTestClient::ServiceTestClient(ServiceTest* test) : test_(test) {} |
| 17 ServiceTestClient::~ServiceTestClient() {} | 17 ServiceTestClient::~ServiceTestClient() {} |
| 18 | 18 |
| 19 void ServiceTestClient::OnStart(const Identity& identity) { | 19 void ServiceTestClient::OnStart(const ServiceInfo& info) { |
| 20 test_->OnStartCalled(connector(), identity.name(), | 20 test_->OnStartCalled(connector(), info.identity.name(), |
| 21 identity.user_id()); | 21 info.identity.user_id()); |
| 22 } | 22 } |
| 23 | 23 |
| 24 ServiceTest::ServiceTest() {} | 24 ServiceTest::ServiceTest() {} |
| 25 ServiceTest::ServiceTest(const std::string& test_name) | 25 ServiceTest::ServiceTest(const std::string& test_name) |
| 26 : test_name_(test_name) {} | 26 : test_name_(test_name) {} |
| 27 ServiceTest::~ServiceTest() {} | 27 ServiceTest::~ServiceTest() {} |
| 28 | 28 |
| 29 void ServiceTest::InitTestName(const std::string& test_name) { | 29 void ServiceTest::InitTestName(const std::string& test_name) { |
| 30 DCHECK(test_name_.empty()); | 30 DCHECK(test_name_.empty()); |
| 31 test_name_ = test_name; | 31 test_name_ = test_name; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ServiceTest::TearDown() { | 73 void ServiceTest::TearDown() { |
| 74 background_service_manager_.reset(); | 74 background_service_manager_.reset(); |
| 75 message_loop_.reset(); | 75 message_loop_.reset(); |
| 76 service_.reset(); | 76 service_.reset(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace test | 79 } // namespace test |
| 80 } // namespace service_manager | 80 } // namespace service_manager |
| OLD | NEW |