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

Side by Side Diff: services/resource_coordinator/coordination_unit/coordination_unit_impl_unittest_util.cc

Issue 2926663003: [GRC] Coordination Unit Graph Observer (Closed)
Patch Set: Rebase Created 3 years, 6 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 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 #include "services/resource_coordinator/coordination_unit/coordination_unit_impl _unittest_util.h" 5 #include "services/resource_coordinator/coordination_unit/coordination_unit_impl _unittest_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 9
10 namespace resource_coordinator { 10 namespace resource_coordinator {
11 11
12 namespace { 12 namespace {
13 13
14 void OnLastServiceRefDestroyed() { 14 void OnLastServiceRefDestroyed() {
15 // No-op. This is required by service_manager::ServiceContextRefFactory 15 // No-op. This is required by service_manager::ServiceContextRefFactory
16 // construction but not needed for the tests. 16 // construction but not needed for the tests.
17 } 17 }
18 18
19 } // namespace 19 } // namespace
20 20
21 CoordinationUnitImplTestBase::CoordinationUnitImplTestBase() 21 CoordinationUnitImplTestBase::CoordinationUnitImplTestBase()
22 : service_ref_factory_(base::Bind(&OnLastServiceRefDestroyed)), 22 : service_ref_factory_(base::Bind(&OnLastServiceRefDestroyed)),
23 provider_(&service_ref_factory_) {} 23 provider_(&service_ref_factory_, &coordination_unit_manager_) {
24 // Ensure tests only include the observers that are needed instead
25 // of what is registered by default to run in a browser instance.
26 coordination_unit_manager_.UnregisterAllObserversForTesting();
Zhen Wang 2017/06/15 20:07:53 Is there another test helper class that can includ
matthalp 2017/06/16 00:01:27 I have gone ahead and removed this function. Inste
27 }
24 28
25 CoordinationUnitImplTestBase::~CoordinationUnitImplTestBase() = default; 29 CoordinationUnitImplTestBase::~CoordinationUnitImplTestBase() = default;
26 30
27 void CoordinationUnitImplTestBase::TearDown() { 31 void CoordinationUnitImplTestBase::TearDown() {
28 base::RunLoop().RunUntilIdle(); 32 base::RunLoop().RunUntilIdle();
29 } 33 }
30 34
31 } // namespace resource_coordinator 35 } // namespace resource_coordinator
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698