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

Unified Diff: services/resource_coordinator/coordination_unit/coordination_unit_impl_base_test_unittest.h

Issue 2892443002: [GRC] Process Coordination Unit support for Global Resource Controller (Closed)
Patch Set: Formatting Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698