Index: content/public/test/mock_render_process_host.cc |
diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc |
index efabfce444a60371907bca9a41666f0b3fdac22d..e8fdc8366a12b7e555bb395913b692ac074d179a 100644 |
--- a/content/public/test/mock_render_process_host.cc |
+++ b/content/public/test/mock_render_process_host.cc |
@@ -30,8 +30,10 @@ |
#include "content/public/browser/notification_types.h" |
#include "content/public/browser/render_widget_host_iterator.h" |
#include "content/public/browser/storage_partition.h" |
+#include "content/public/common/service_manager_connection.h" |
#include "media/media_features.h" |
#include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
+#include "services/resource_coordinator/public/interfaces/coordination_unit.mojom.h" |
namespace content { |
@@ -347,8 +349,14 @@ mojom::Renderer* MockRenderProcessHost::GetRendererInterface() { |
resource_coordinator::ResourceCoordinatorInterface* |
MockRenderProcessHost::GetProcessResourceCoordinator() { |
- NOTREACHED(); |
- return nullptr; |
+ if (!process_resource_coordinator_) { |
+ service_manager::Connector* connector = |
+ content::ServiceManagerConnection::GetForProcess()->GetConnector(); |
+ process_resource_coordinator_ = |
+ base::MakeUnique<resource_coordinator::ResourceCoordinatorInterface>( |
+ connector, resource_coordinator::CoordinationUnitType::kProcess); |
+ } |
+ return process_resource_coordinator_.get(); |
} |
void MockRenderProcessHost::SetIsNeverSuitableForReuse() { |