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

Side by Side Diff: services/service_manager/public/cpp/service_test.h

Issue 2597983003: Add tests for how LocalStorageContextMojo interacts with file/leveldb services. (Closed)
Patch Set: reapply change that got lost during rebase Created 3 years, 11 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
« no previous file with comments | « services/service_manager/public/cpp/lib/service_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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); 55 explicit ServiceTest(const std::string& test_name, bool init_edk = true);
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
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;
95 96
96 Connector* connector_ = nullptr; 97 Connector* connector_ = nullptr;
97 std::string initialize_name_; 98 std::string initialize_name_;
98 std::string initialize_userid_ = service_manager::mojom::kInheritUserID; 99 std::string initialize_userid_ = service_manager::mojom::kInheritUserID;
99 uint32_t initialize_instance_id_ = service_manager::mojom::kInvalidInstanceID; 100 uint32_t initialize_instance_id_ = service_manager::mojom::kInvalidInstanceID;
100 101
101 base::Closure initialize_called_; 102 base::Closure initialize_called_;
102 103
103 DISALLOW_COPY_AND_ASSIGN(ServiceTest); 104 DISALLOW_COPY_AND_ASSIGN(ServiceTest);
104 }; 105 };
105 106
106 } // namespace test 107 } // namespace test
107 } // namespace service_manager 108 } // namespace service_manager
108 109
109 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_ 110 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_TEST_H_
OLDNEW
« no previous file with comments | « services/service_manager/public/cpp/lib/service_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698