| 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 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ |
| 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // to customize this should subclass this class instead of Service, | 36 // to customize this should subclass this class instead of Service, |
| 37 // otherwise they will have to call ServiceTest::OnStartCalled() to forward | 37 // otherwise they will have to call ServiceTest::OnStartCalled() to forward |
| 38 // metadata from OnStart() to the test. | 38 // metadata from OnStart() to the test. |
| 39 class ServiceTestClient : public Service { | 39 class ServiceTestClient : public Service { |
| 40 public: | 40 public: |
| 41 explicit ServiceTestClient(ServiceTest* test); | 41 explicit ServiceTestClient(ServiceTest* test); |
| 42 ~ServiceTestClient() override; | 42 ~ServiceTestClient() override; |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 void OnStart() override; | 45 void OnStart() override; |
| 46 bool OnConnect(const ServiceInfo& remote_info, | 46 void OnBindInterface(const ServiceInfo& source_info, |
| 47 InterfaceRegistry* registry) override; | 47 const std::string& interface_name, |
| 48 mojo::ScopedMessagePipeHandle interface_pipe) override; |
| 48 | 49 |
| 49 private: | 50 private: |
| 50 ServiceTest* test_; | 51 ServiceTest* test_; |
| 51 | 52 |
| 52 DISALLOW_COPY_AND_ASSIGN(ServiceTestClient); | 53 DISALLOW_COPY_AND_ASSIGN(ServiceTestClient); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 class ServiceTest : public testing::Test { | 56 class ServiceTest : public testing::Test { |
| 56 public: | 57 public: |
| 57 ServiceTest(); | 58 ServiceTest(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 111 |
| 111 base::Closure initialize_called_; | 112 base::Closure initialize_called_; |
| 112 | 113 |
| 113 DISALLOW_COPY_AND_ASSIGN(ServiceTest); | 114 DISALLOW_COPY_AND_ASSIGN(ServiceTest); |
| 114 }; | 115 }; |
| 115 | 116 |
| 116 } // namespace test | 117 } // namespace test |
| 117 } // namespace service_manager | 118 } // namespace service_manager |
| 118 | 119 |
| 119 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ | 120 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ |
| OLD | NEW |