OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 #include "content/public/test/memory_coordinator_test_utils.h" |
| 6 |
| 7 #include "base/memory/memory_coordinator_proxy.h" |
| 8 #include "content/browser/memory/memory_coordinator.h" |
| 9 #include "content/public/common/content_features.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 void EnableFeaturesForTesting() { |
| 14 base::FeatureList::ClearInstanceForTesting(); |
| 15 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 16 feature_list->InitializeFromCommandLine(features::kMemoryCoordinator.name, |
| 17 ""); |
| 18 base::FeatureList::SetInstance(std::move(feature_list)); |
| 19 } |
| 20 |
| 21 void SetUpMemoryCoordinatorProxyForTesting() { |
| 22 base::MemoryCoordinatorProxy::GetInstance()-> |
| 23 SetGetCurrentMemoryStateCallback(base::Bind( |
| 24 &content::MemoryCoordinator::GetCurrentMemoryState, |
| 25 base::Unretained(content::MemoryCoordinator::GetInstance()))); |
| 26 base::MemoryCoordinatorProxy::GetInstance()-> |
| 27 SetSetCurrentMemoryStateForTestingCallback(base::Bind( |
| 28 &content::MemoryCoordinator::SetCurrentMemoryStateForTesting, |
| 29 base::Unretained(content::MemoryCoordinator::GetInstance()))); |
| 30 } |
| 31 |
| 32 } // namespace content |
OLD | NEW |