| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/test/mock_render_process_host.h" | 5 #include "content/public/test/mock_render_process_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/common/frame_messages.h" | 22 #include "content/common/frame_messages.h" |
| 23 #include "content/common/renderer.mojom.h" | 23 #include "content/common/renderer.mojom.h" |
| 24 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
| 25 #include "content/public/browser/global_request_id.h" | 25 #include "content/public/browser/global_request_id.h" |
| 26 #include "content/public/browser/notification_details.h" | 26 #include "content/public/browser/notification_details.h" |
| 27 #include "content/public/browser/notification_service.h" | 27 #include "content/public/browser/notification_service.h" |
| 28 #include "content/public/browser/notification_source.h" | 28 #include "content/public/browser/notification_source.h" |
| 29 #include "content/public/browser/notification_types.h" | 29 #include "content/public/browser/notification_types.h" |
| 30 #include "content/public/browser/render_widget_host_iterator.h" | 30 #include "content/public/browser/render_widget_host_iterator.h" |
| 31 #include "content/public/browser/storage_partition.h" | 31 #include "content/public/browser/storage_partition.h" |
| 32 #include "content/public/test/fake_associated_interface_provider_impl.h" |
| 32 #include "media/media_features.h" | 33 #include "media/media_features.h" |
| 33 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 34 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| 34 | 35 |
| 35 namespace content { | 36 namespace content { |
| 36 | 37 |
| 37 MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) | 38 MockRenderProcessHost::MockRenderProcessHost(BrowserContext* browser_context) |
| 38 : bad_msg_count_(0), | 39 : bad_msg_count_(0), |
| 39 factory_(NULL), | 40 factory_(NULL), |
| 40 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), | 41 id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()), |
| 41 has_connection_(false), | 42 has_connection_(false), |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 254 |
| 254 base::TimeDelta MockRenderProcessHost::GetChildProcessIdleTime() const { | 255 base::TimeDelta MockRenderProcessHost::GetChildProcessIdleTime() const { |
| 255 return base::TimeDelta::FromMilliseconds(0); | 256 return base::TimeDelta::FromMilliseconds(0); |
| 256 } | 257 } |
| 257 | 258 |
| 258 service_manager::InterfaceProvider* | 259 service_manager::InterfaceProvider* |
| 259 MockRenderProcessHost::GetRemoteInterfaces() { | 260 MockRenderProcessHost::GetRemoteInterfaces() { |
| 260 return remote_interfaces_.get(); | 261 return remote_interfaces_.get(); |
| 261 } | 262 } |
| 262 | 263 |
| 264 AssociatedInterfaceProvider* |
| 265 MockRenderProcessHost::GetAssociatedInterfaceProviderForTesting() { |
| 266 if (!fake_associated_interface_provider_) { |
| 267 fake_associated_interface_provider_ = |
| 268 base::MakeUnique<FakeAssociatedInterfaceProviderImpl>(); |
| 269 } |
| 270 |
| 271 return fake_associated_interface_provider_.get(); |
| 272 } |
| 273 |
| 263 std::unique_ptr<base::SharedPersistentMemoryAllocator> | 274 std::unique_ptr<base::SharedPersistentMemoryAllocator> |
| 264 MockRenderProcessHost::TakeMetricsAllocator() { | 275 MockRenderProcessHost::TakeMetricsAllocator() { |
| 265 return nullptr; | 276 return nullptr; |
| 266 } | 277 } |
| 267 | 278 |
| 268 const base::TimeTicks& MockRenderProcessHost::GetInitTimeForNavigationMetrics() | 279 const base::TimeTicks& MockRenderProcessHost::GetInitTimeForNavigationMetrics() |
| 269 const { | 280 const { |
| 270 static base::TimeTicks dummy_time = base::TimeTicks::Now(); | 281 static base::TimeTicks dummy_time = base::TimeTicks::Now(); |
| 271 return dummy_time; | 282 return dummy_time; |
| 272 } | 283 } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); | 399 for (ScopedVector<MockRenderProcessHost>::iterator it = processes_.begin(); |
| 389 it != processes_.end(); ++it) { | 400 it != processes_.end(); ++it) { |
| 390 if (*it == host) { | 401 if (*it == host) { |
| 391 processes_.weak_erase(it); | 402 processes_.weak_erase(it); |
| 392 break; | 403 break; |
| 393 } | 404 } |
| 394 } | 405 } |
| 395 } | 406 } |
| 396 | 407 |
| 397 } // namespace content | 408 } // namespace content |
| OLD | NEW |