| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 DISALLOW_COPY_AND_ASSIGN(ServiceTestClient); | 45 DISALLOW_COPY_AND_ASSIGN(ServiceTestClient); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 class ServiceTest : public testing::Test { | 48 class ServiceTest : public testing::Test { |
| 49 public: | 49 public: |
| 50 ServiceTest(); | 50 ServiceTest(); |
| 51 // Initialize passing the name to use as the identity for the test itself. | 51 // Initialize passing the name to use as the identity for the test itself. |
| 52 // Once set via this constructor, it cannot be changed later by calling | 52 // Once set via this constructor, it cannot be changed later by calling |
| 53 // InitTestName(). The test executable must provide a manifest in the | 53 // InitTestName(). The test executable must provide a manifest in the |
| 54 // appropriate location that specifies this name also. | 54 // appropriate location that specifies this name also. |
| 55 explicit ServiceTest(const std::string& test_name, bool init_edk = true); | 55 explicit ServiceTest(const std::string& test_name); |
| 56 ~ServiceTest() override; | 56 ~ServiceTest() override; |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 // See constructor. Can only be called once. | 59 // See constructor. Can only be called once. |
| 60 void InitTestName(const std::string& test_name); | 60 void InitTestName(const std::string& test_name); |
| 61 | 61 |
| 62 Connector* connector() { return connector_; } | 62 Connector* connector() { return connector_; } |
| 63 | 63 |
| 64 // Instance information received from the Service Manager during OnStart(). | 64 // Instance information received from the Service Manager during OnStart(). |
| 65 const std::string& test_name() const { return initialize_name_; } | 65 const std::string& test_name() const { return initialize_name_; } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 friend ServiceTestClient; | 87 friend ServiceTestClient; |
| 88 | 88 |
| 89 std::unique_ptr<ServiceContext> context_; | 89 std::unique_ptr<ServiceContext> context_; |
| 90 std::unique_ptr<base::MessageLoop> message_loop_; | 90 std::unique_ptr<base::MessageLoop> message_loop_; |
| 91 std::unique_ptr<BackgroundServiceManager> background_service_manager_; | 91 std::unique_ptr<BackgroundServiceManager> background_service_manager_; |
| 92 | 92 |
| 93 // See constructor. | 93 // See constructor. |
| 94 std::string test_name_; | 94 std::string test_name_; |
| 95 bool init_edk_ = true; | |
| 96 | 95 |
| 97 Connector* connector_ = nullptr; | 96 Connector* connector_ = nullptr; |
| 98 std::string initialize_name_; | 97 std::string initialize_name_; |
| 99 std::string initialize_userid_ = service_manager::mojom::kInheritUserID; | 98 std::string initialize_userid_ = service_manager::mojom::kInheritUserID; |
| 100 uint32_t initialize_instance_id_ = service_manager::mojom::kInvalidInstanceID; | 99 uint32_t initialize_instance_id_ = service_manager::mojom::kInvalidInstanceID; |
| 101 | 100 |
| 102 base::Closure initialize_called_; | 101 base::Closure initialize_called_; |
| 103 | 102 |
| 104 DISALLOW_COPY_AND_ASSIGN(ServiceTest); | 103 DISALLOW_COPY_AND_ASSIGN(ServiceTest); |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 } // namespace test | 106 } // namespace test |
| 108 } // namespace service_manager | 107 } // namespace service_manager |
| 109 | 108 |
| 110 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ | 109 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ |
| OLD | NEW |