OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_BASE_T EST_UNITTEST_H_ | |
6 #define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_BASE_T EST_UNITTEST_H_ | |
7 | |
8 #include "base/bind.h" | |
9 #include "base/message_loop/message_loop.h" | |
10 #include "base/run_loop.h" | |
11 #include "services/resource_coordinator/coordination_unit/coordination_unit_prov ider_impl.h" | |
12 #include "services/service_manager/public/cpp/service_context_ref.h" | |
13 #include "testing/gtest/include/gtest/gtest.h" | |
14 | |
15 namespace resource_coordinator { | |
16 | |
17 namespace { | |
18 | |
19 void OnLastServiceRefDestroyed() { | |
20 // No-op. This is required by service_manager::ServiceContextRefFactory | |
21 // construction but not needed for the tests. | |
22 } | |
23 | |
24 } // namespace | |
25 | |
26 class CoordinationUnitImplBaseTest : public testing::Test { | |
27 public: | |
28 CoordinationUnitImplBaseTest() | |
matthalp
2017/05/18 16:13:45
Is this good here or should the relevant parts be
| |
29 : service_ref_factory_(base::Bind(&OnLastServiceRefDestroyed)), | |
30 provider_(&service_ref_factory_) {} | |
31 ~CoordinationUnitImplBaseTest() override {} | |
32 | |
33 // testing::Test: | |
34 void TearDown() override; | |
35 | |
36 protected: | |
37 service_manager::ServiceContextRefFactory* ServiceContextRefFactory() { | |
38 return &service_ref_factory_; | |
39 } | |
40 CoordinationUnitProviderImpl* provider() { return &provider_; } | |
41 | |
42 private: | |
43 base::MessageLoop message_loop_; | |
44 | |
45 service_manager::ServiceContextRefFactory service_ref_factory_; | |
46 CoordinationUnitProviderImpl provider_; | |
47 }; | |
48 | |
49 } // namespace resource_coordinator | |
50 | |
51 #endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_BAS E_TEST_UNITTEST_H_ | |
OLD | NEW |