Chromium Code Reviews| Index: services/resource_coordinator/coordination_unit/coordination_unit_impl_base_test_unittest.h |
| diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_impl_base_test_unittest.h b/services/resource_coordinator/coordination_unit/coordination_unit_impl_base_test_unittest.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d3e690cfe88cac0286af0b52e9e55ee3612735fe |
| --- /dev/null |
| +++ b/services/resource_coordinator/coordination_unit/coordination_unit_impl_base_test_unittest.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_BASE_TEST_UNITTEST_H_ |
| +#define SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_BASE_TEST_UNITTEST_H_ |
| + |
| +#include "base/bind.h" |
| +#include "base/message_loop/message_loop.h" |
| +#include "base/run_loop.h" |
| +#include "services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h" |
| +#include "services/service_manager/public/cpp/service_context_ref.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace resource_coordinator { |
| + |
| +namespace { |
| + |
| +void OnLastServiceRefDestroyed() { |
| + // No-op. This is required by service_manager::ServiceContextRefFactory |
| + // construction but not needed for the tests. |
| +} |
| + |
| +} // namespace |
| + |
| +class CoordinationUnitImplBaseTest : public testing::Test { |
| + public: |
| + CoordinationUnitImplBaseTest() |
|
matthalp
2017/05/18 16:13:45
Is this good here or should the relevant parts be
|
| + : service_ref_factory_(base::Bind(&OnLastServiceRefDestroyed)), |
| + provider_(&service_ref_factory_) {} |
| + ~CoordinationUnitImplBaseTest() override {} |
| + |
| + // testing::Test: |
| + void TearDown() override; |
| + |
| + protected: |
| + service_manager::ServiceContextRefFactory* ServiceContextRefFactory() { |
| + return &service_ref_factory_; |
| + } |
| + CoordinationUnitProviderImpl* provider() { return &provider_; } |
| + |
| + private: |
| + base::MessageLoop message_loop_; |
| + |
| + service_manager::ServiceContextRefFactory service_ref_factory_; |
| + CoordinationUnitProviderImpl provider_; |
| +}; |
| + |
| +} // namespace resource_coordinator |
| + |
| +#endif // SERVICES_RESOURCE_COORDINATOR_COORDINATION_UNIT_COORDINATION_UNIT_BASE_TEST_UNITTEST_H_ |