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

Unified Diff: services/resource_coordinator/resource_coordinator_service_unittest.cc

Issue 2856173003: Revert of Global Resource Coordinator: Basic service internals (Closed)
Patch Set: Created 3 years, 8 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/resource_coordinator_service_unittest.cc
diff --git a/services/resource_coordinator/resource_coordinator_service_unittest.cc b/services/resource_coordinator/resource_coordinator_service_unittest.cc
deleted file mode 100644
index fd17c20f5eb3848da2fe8957c11f51e7d8327a55..0000000000000000000000000000000000000000
--- a/services/resource_coordinator/resource_coordinator_service_unittest.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2015 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.
-
-#include <memory>
-
-#include "base/macros.h"
-#include "base/run_loop.h"
-#include "mojo/public/cpp/bindings/binding.h"
-#include "services/resource_coordinator/public/interfaces/coordination_unit_provider.mojom.h"
-#include "services/resource_coordinator/public/interfaces/service_constants.mojom.h"
-#include "services/service_manager/public/cpp/service.h"
-#include "services/service_manager/public/cpp/service_test.h"
-
-namespace resource_coordinator {
-
-class ResourceCoordinatorTest : public service_manager::test::ServiceTest,
- public mojom::CoordinationPolicyCallback {
- public:
- ResourceCoordinatorTest()
- : service_manager::test::ServiceTest("resource_coordinator_unittests"),
- binding_(this) {}
- ~ResourceCoordinatorTest() override {}
-
- protected:
- void SetUp() override {
- service_manager::test::ServiceTest::SetUp();
- connector()->StartService(mojom::kServiceName);
- }
-
- mojom::CoordinationPolicyCallbackPtr GetPolicyCallback() {
- return binding_.CreateInterfacePtrAndBind();
- }
-
- void QuitOnPolicyCallback(base::RunLoop* loop) { loop_ = loop; }
-
- private:
- // mojom::CoordinationPolicyCallback:
- void SetCoordinationPolicy(
- resource_coordinator::mojom::CoordinationPolicyPtr policy) override {
- loop_->Quit();
- }
-
- mojo::Binding<mojom::CoordinationPolicyCallback> binding_;
- base::RunLoop* loop_ = nullptr;
-
- DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorTest);
-};
-
-TEST_F(ResourceCoordinatorTest, ResourceCoordinatorInstantiate) {
- mojom::CoordinationUnitProviderPtr provider;
- connector()->BindInterface(mojom::kServiceName, mojo::MakeRequest(&provider));
-
- CoordinationUnitID new_id(CoordinationUnitType::kWebContents, "test_id");
- mojom::CoordinationUnitPtr coordination_unit;
- provider->CreateCoordinationUnit(mojo::MakeRequest(&coordination_unit),
- new_id);
-
- coordination_unit->SetCoordinationPolicyCallback(GetPolicyCallback());
-
- base::RunLoop loop;
- QuitOnPolicyCallback(&loop);
- loop.Run();
-}
-
-} // namespace resource_coordinator
« no previous file with comments | « services/resource_coordinator/resource_coordinator_service.cc ('k') | services/resource_coordinator/service_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698