summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 14:53:23 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 14:53:23 +0000
commiteddd88670201189cab376fb7388c1cd786bc024a (patch)
treebe274f8a886f2105795414a27e5accf5eca559a0
parent835db9b1b9dae019f6262c881ef61a53a179f830 (diff)
downloadchromium_src-eddd88670201189cab376fb7388c1cd786bc024a.zip
chromium_src-eddd88670201189cab376fb7388c1cd786bc024a.tar.gz
chromium_src-eddd88670201189cab376fb7388c1cd786bc024a.tar.bz2
Move MockRenderProcessHost to content/test and put it into the content namespace.
BUG=98716 R=jam@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/9699082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127163 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/DEPS1
-rw-r--r--chrome/browser/autofill/autofill_browsertest.cc2
-rw-r--r--chrome/browser/autofill/autofill_manager_unittest.cc2
-rw-r--r--chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc3
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_host_unittest.cc2
-rw-r--r--chrome/browser/tab_contents/thumbnail_generator_unittest.cc2
-rw-r--r--chrome/browser/translate/translate_manager_browsertest.cc4
-rw-r--r--chrome/browser/visitedlink/visitedlink_unittest.cc3
-rw-r--r--content/browser/renderer_host/render_view_host_unittest.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host_unittest.cc3
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm3
-rw-r--r--content/browser/renderer_host/text_input_client_mac_unittest.mm3
-rw-r--r--content/browser/site_instance_impl_unittest.cc4
-rw-r--r--content/browser/tab_contents/navigation_controller_impl_unittest.cc2
-rw-r--r--content/browser/tab_contents/render_view_host_manager_unittest.cc5
-rw-r--r--content/browser/tab_contents/tab_contents_unittest.cc3
-rw-r--r--content/browser/tab_contents/test_tab_contents.cc4
-rw-r--r--content/content_tests.gypi6
-rw-r--r--content/test/mock_render_process_host.cc (renamed from content/browser/renderer_host/mock_render_process_host.cc)26
-rw-r--r--content/test/mock_render_process_host.h (renamed from content/browser/renderer_host/mock_render_process_host.h)29
-rw-r--r--content/test/test_renderer_host.cc2
-rw-r--r--content/test/test_renderer_host.h4
22 files changed, 64 insertions, 51 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index 70dd958..624ca50 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -33,7 +33,6 @@ include_rules = [
# DO NOT ADD ANY MORE ITEMS TO THE LIST BELOW!
"+content/browser/download/download_state_info.h",
"+content/browser/geolocation/wifi_data_provider_common.h",
- "+content/browser/renderer_host/mock_render_process_host.h",
"+content/browser/renderer_host/render_process_host_browsertest.h",
"+content/browser/renderer_host/render_view_host_factory.h",
"+content/browser/renderer_host/render_widget_host_view_mac_delegate.h",
diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc
index 39eeac7..7c28a78 100644
--- a/chrome/browser/autofill/autofill_browsertest.cc
+++ b/chrome/browser/autofill/autofill_browsertest.cc
@@ -26,11 +26,11 @@
#include "chrome/renderer/translate_helper.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_url_fetcher_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/keycodes/keyboard_codes.h"
diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc
index 94ec873..2938428 100644
--- a/chrome/browser/autofill/autofill_manager_unittest.cc
+++ b/chrome/browser/autofill/autofill_manager_unittest.cc
@@ -30,8 +30,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/tab_contents/test_tab_contents.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_thread.h"
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
index c1ca818..cd58345 100644
--- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc
@@ -19,17 +19,18 @@
#include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/tab_contents/test_tab_contents.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
#include "content/test/mock_geolocation.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_renderer_host.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
+using content::MockRenderProcessHost;
using content::RenderViewHostTester;
using content::WebContents;
diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
index 5e77a1d..6fd68cc 100644
--- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc
@@ -16,8 +16,8 @@
#include "chrome/common/safe_browsing/csd.pb.h"
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/tab_contents/test_tab_contents.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_renderer_host.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc
index 051bbb4..8fbe7ed 100644
--- a/chrome/browser/tab_contents/thumbnail_generator_unittest.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator_unittest.cc
@@ -8,9 +8,9 @@
#include "chrome/browser/tab_contents/thumbnail_generator.h"
#include "chrome/common/render_messages.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_renderer_host.h"
#include "skia/ext/platform_canvas.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc
index 71382da..578cf82 100644
--- a/chrome/browser/translate/translate_manager_browsertest.cc
+++ b/chrome/browser/translate/translate_manager_browsertest.cc
@@ -28,18 +28,18 @@
#include "chrome/common/render_messages.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/tab_contents/test_tab_contents.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/notification_observer_mock.h"
#include "content/test/render_view_test.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_renderer_host.h"
-#include "content/test/test_url_fetcher_factory.h"
#include "content/test/test_renderer_host.h"
+#include "content/test/test_url_fetcher_factory.h"
#include "grit/generated_resources.h"
#include "ipc/ipc_test_sink.h"
#include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/visitedlink/visitedlink_unittest.cc b/chrome/browser/visitedlink/visitedlink_unittest.cc
index e12a533..54228bb 100644
--- a/chrome/browser/visitedlink/visitedlink_unittest.cc
+++ b/chrome/browser/visitedlink/visitedlink_unittest.cc
@@ -18,15 +18,16 @@
#include "chrome/renderer/visitedlink_slave.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_renderer_host.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
+using content::MockRenderProcessHost;
using content::RenderViewHostTester;
namespace {
diff --git a/content/browser/renderer_host/render_view_host_unittest.cc b/content/browser/renderer_host/render_view_host_unittest.cc
index 87a7be2..a182683 100644
--- a/content/browser/renderer_host/render_view_host_unittest.cc
+++ b/content/browser/renderer_host/render_view_host_unittest.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "content/browser/child_process_security_policy_impl.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/tab_contents/navigation_controller_impl.h"
#include "content/browser/tab_contents/test_tab_contents.h"
@@ -11,6 +10,7 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/page_transition_types.h"
+#include "content/test/mock_render_process_host.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
#include "webkit/glue/webdropdata.h"
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc
index 69d9206..b56d4fea 100644
--- a/content/browser/renderer_host/render_widget_host_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -8,7 +8,6 @@
#include "base/timer.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/renderer_host/backing_store.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/common/view_messages.h"
#include "content/port/browser/render_widget_host_view_port.h"
@@ -17,6 +16,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/keycodes/keyboard_codes.h"
@@ -29,6 +29,7 @@
using base::TimeDelta;
using content::BrowserThread;
using content::BrowserThreadImpl;
+using content::MockRenderProcessHost;
using content::RenderWidgetHost;
using content::RenderWidgetHostImpl;
using WebKit::WebInputEvent;
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
index 39b5c47..a0d8628 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm
@@ -7,14 +7,15 @@
#import <Cocoa/Cocoa.h>
#include "base/message_loop.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/view_messages.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
+using content::MockRenderProcessHost;
using content::RenderWidgetHostImpl;
class RenderWidgetHostViewMacEditCommandHelperTest : public PlatformTest {
diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm
index 1791d32..26b3846 100644
--- a/content/browser/renderer_host/text_input_client_mac_unittest.mm
+++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm
@@ -7,16 +7,17 @@
#include "base/bind.h"
#include "base/message_loop.h"
#include "base/threading/thread.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/text_input_client_message_filter.h"
#include "content/common/text_input_client_messages.h"
#include "content/test//test_browser_context.h"
+#include "content/test/mock_render_process_host.h"
#include "ipc/ipc_test_sink.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gtest_mac.h"
+using content::MockRenderProcessHost;
using content::RenderWidgetHostImpl;
namespace {
diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc
index fb72207..c861716 100644
--- a/content/browser/site_instance_impl_unittest.cc
+++ b/content/browser/site_instance_impl_unittest.cc
@@ -9,7 +9,6 @@
#include "content/browser/browsing_instance.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/mock_content_browser_client.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/test_render_view_host.h"
@@ -20,6 +19,7 @@
#include "content/public/common/content_client.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
#include "content/test/test_content_client.h"
#include "googleurl/src/url_util.h"
@@ -28,6 +28,8 @@
using content::BrowserContext;
using content::BrowserThread;
using content::BrowserThreadImpl;
+using content::MockRenderProcessHost;
+using content::MockRenderProcessHostFactory;
using content::NavigationEntry;
using content::NavigationEntryImpl;
using content::SiteInstance;
diff --git a/content/browser/tab_contents/navigation_controller_impl_unittest.cc b/content/browser/tab_contents/navigation_controller_impl_unittest.cc
index ce08160..3120fe3 100644
--- a/content/browser/tab_contents/navigation_controller_impl_unittest.cc
+++ b/content/browser/tab_contents/navigation_controller_impl_unittest.cc
@@ -16,7 +16,6 @@
// #include "chrome/browser/sessions/session_service_factory.h"
// #include "chrome/browser/sessions/session_service_test_helper.h"
// #include "chrome/browser/sessions/session_types.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/tab_contents/navigation_controller_impl.h"
@@ -28,6 +27,7 @@
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
#include "content/test/test_notification_tracker.h"
#include "net/base/net_util.h"
diff --git a/content/browser/tab_contents/render_view_host_manager_unittest.cc b/content/browser/tab_contents/render_view_host_manager_unittest.cc
index 35c3499..5ac2cbf 100644
--- a/content/browser/tab_contents/render_view_host_manager_unittest.cc
+++ b/content/browser/tab_contents/render_view_host_manager_unittest.cc
@@ -5,7 +5,6 @@
#include "base/utf_string_conversions.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/mock_content_browser_client.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/tab_contents/navigation_controller_impl.h"
@@ -21,17 +20,19 @@
#include "content/public/browser/web_ui_controller_factory.h"
#include "content/public/common/page_transition_types.h"
#include "content/public/common/url_constants.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
#include "content/test/test_content_client.h"
#include "content/test/test_notification_tracker.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "googleurl/src/url_util.h"
+#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/javascript_message_type.h"
#include "webkit/glue/webkit_glue.h"
using content::BrowserContext;
using content::BrowserThread;
using content::BrowserThreadImpl;
+using content::MockRenderProcessHost;
using content::NavigationController;
using content::NavigationEntry;
using content::NavigationEntryImpl;
diff --git a/content/browser/tab_contents/tab_contents_unittest.cc b/content/browser/tab_contents/tab_contents_unittest.cc
index 27cf97da..cc4acd7 100644
--- a/content/browser/tab_contents/tab_contents_unittest.cc
+++ b/content/browser/tab_contents/tab_contents_unittest.cc
@@ -5,7 +5,6 @@
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "content/browser/mock_content_browser_client.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
@@ -24,6 +23,7 @@
#include "content/public/common/bindings_policy.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/url_constants.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_thread.h"
#include "content/test/test_content_client.h"
#include "googleurl/src/url_util.h"
@@ -33,6 +33,7 @@
using content::BrowserContext;
using content::BrowserThread;
using content::InterstitialPage;
+using content::MockRenderProcessHost;
using content::NavigationEntry;
using content::NavigationEntryImpl;
using content::SiteInstance;
diff --git a/content/browser/tab_contents/test_tab_contents.cc b/content/browser/tab_contents/test_tab_contents.cc
index 0439e44..dc582f2 100644
--- a/content/browser/tab_contents/test_tab_contents.cc
+++ b/content/browser/tab_contents/test_tab_contents.cc
@@ -7,15 +7,15 @@
#include <utility>
#include "content/browser/browser_url_handler_impl.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/tab_contents/navigation_entry_impl.h"
#include "content/common/view_messages.h"
#include "content/public/common/page_transition_types.h"
-#include "webkit/glue/webkit_glue.h"
+#include "content/test/mock_render_process_host.h"
#include "webkit/forms/password_form.h"
+#include "webkit/glue/webkit_glue.h"
using content::NavigationEntry;
using content::RenderViewHost;
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 9c1cbe9..ae8a7a0 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -42,8 +42,6 @@
'browser/renderer_host/test_backing_store.h',
'browser/renderer_host/test_render_view_host.cc',
'browser/renderer_host/test_render_view_host.h',
- 'browser/renderer_host/mock_render_process_host.cc',
- 'browser/renderer_host/mock_render_process_host.h',
'browser/tab_contents/test_tab_contents.cc',
'browser/tab_contents/test_tab_contents.h',
'common/test_url_constants.cc',
@@ -69,11 +67,13 @@
'test/mock_geolocation.cc',
'test/mock_geolocation.h',
'test/mock_keyboard.cc',
- 'test/mock_keyboard.h',
'test/mock_keyboard_driver_win.cc',
'test/mock_keyboard_driver_win.h',
+ 'test/mock_keyboard.h',
'test/mock_render_process.cc',
'test/mock_render_process.h',
+ 'test/mock_render_process_host.cc',
+ 'test/mock_render_process_host.h',
'test/mock_render_thread.cc',
'test/mock_render_thread.h',
'test/mock_resource_context.cc',
diff --git a/content/browser/renderer_host/mock_render_process_host.cc b/content/test/mock_render_process_host.cc
index 7270d84..90ba216 100644
--- a/content/browser/renderer_host/mock_render_process_host.cc
+++ b/content/test/mock_render_process_host.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/mock_render_process_host.h"
+#include "content/test/mock_render_process_host.h"
#include "base/lazy_instance.h"
#include "base/message_loop.h"
@@ -13,11 +13,10 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
-using content::ChildProcessHostImpl;
-using content::RenderWidgetHost;
+namespace content {
MockRenderProcessHost::MockRenderProcessHost(
- content::BrowserContext* browser_context)
+ BrowserContext* browser_context)
: transport_dib_(NULL),
bad_msg_count_(0),
factory_(NULL),
@@ -156,10 +155,10 @@ void MockRenderProcessHost::Release(int routing_id) {
void MockRenderProcessHost::Cleanup() {
if (render_widget_hosts_.IsEmpty()) {
- content::NotificationService::current()->Notify(
- content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
- content::Source<RenderProcessHost>(this),
- content::NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ NOTIFICATION_RENDERER_PROCESS_TERMINATED,
+ Source<RenderProcessHost>(this),
+ NotificationService::NoDetails());
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
RenderProcessHostImpl::UnregisterHost(GetID());
}
@@ -183,7 +182,7 @@ content::RenderWidgetHost* MockRenderProcessHost::GetRenderWidgetHostByID(
return render_widget_hosts_.Lookup(routing_id);
}
-content::BrowserContext* MockRenderProcessHost::GetBrowserContext() const {
+BrowserContext* MockRenderProcessHost::GetBrowserContext() const {
return browser_context_;
}
@@ -204,7 +203,7 @@ base::TimeDelta MockRenderProcessHost::GetChildProcessIdleTime() const {
void MockRenderProcessHost::SurfaceUpdated(int32 surface_id) {
}
-content::RenderProcessHost::RenderWidgetHostsIterator
+RenderProcessHost::RenderWidgetHostsIterator
MockRenderProcessHost::GetRenderWidgetHostsIterator() {
return RenderWidgetHostsIterator(&render_widget_hosts_);
}
@@ -227,9 +226,8 @@ MockRenderProcessHostFactory::~MockRenderProcessHostFactory() {
}
}
-content::RenderProcessHost*
- MockRenderProcessHostFactory::CreateRenderProcessHost(
- content::BrowserContext* browser_context) const {
+RenderProcessHost* MockRenderProcessHostFactory::CreateRenderProcessHost(
+ BrowserContext* browser_context) const {
MockRenderProcessHost* host = new MockRenderProcessHost(browser_context);
if (host) {
processes_.push_back(host);
@@ -247,3 +245,5 @@ void MockRenderProcessHostFactory::Remove(MockRenderProcessHost* host) const {
}
}
}
+
+} // content
diff --git a/content/browser/renderer_host/mock_render_process_host.h b/content/test/mock_render_process_host.h
index 58db264..4726f66 100644
--- a/content/browser/renderer_host/mock_render_process_host.h
+++ b/content/test/mock_render_process_host.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_
-#define CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_
+#ifndef CONTENT_TEST_MOCK_RENDER_PROCESS_HOST_H_
+#define CONTENT_TEST_MOCK_RENDER_PROCESS_HOST_H_
#pragma once
#include "base/basictypes.h"
@@ -12,14 +12,17 @@
#include "content/public/browser/render_process_host_factory.h"
#include "ipc/ipc_test_sink.h"
-class MockRenderProcessHostFactory;
class TransportDIB;
+namespace content {
+
+class MockRenderProcessHostFactory;
+
// A mock render process host that has no corresponding renderer process. All
// IPC messages are sent into the message sink for inspection by tests.
-class MockRenderProcessHost : public content::RenderProcessHost {
+class MockRenderProcessHost : public RenderProcessHost {
public:
- explicit MockRenderProcessHost(content::BrowserContext* browser_context);
+ explicit MockRenderProcessHost(BrowserContext* browser_context);
virtual ~MockRenderProcessHost();
// Provides access to all IPC messages that would have been sent to the
@@ -61,9 +64,9 @@ class MockRenderProcessHost : public content::RenderProcessHost {
virtual void RemovePendingView() OVERRIDE;
virtual void SetSuddenTerminationAllowed(bool allowed) OVERRIDE;
virtual bool SuddenTerminationAllowed() const OVERRIDE;
- virtual content::RenderWidgetHost* GetRenderWidgetHostByID(int routing_id)
+ virtual RenderWidgetHost* GetRenderWidgetHostByID(int routing_id)
OVERRIDE;
- virtual content::BrowserContext* GetBrowserContext() const OVERRIDE;
+ virtual BrowserContext* GetBrowserContext() const OVERRIDE;
virtual IPC::ChannelProxy* GetChannel() OVERRIDE;
virtual RenderWidgetHostsIterator GetRenderWidgetHostsIterator() OVERRIDE;
virtual bool FastShutdownForPageCount(size_t count) OVERRIDE;
@@ -90,7 +93,7 @@ class MockRenderProcessHost : public content::RenderProcessHost {
int bad_msg_count_;
const MockRenderProcessHostFactory* factory_;
int id_;
- content::BrowserContext* browser_context_;
+ BrowserContext* browser_context_;
IDMap<content::RenderWidgetHost> render_widget_hosts_;
bool fast_shutdown_started_;
@@ -98,13 +101,13 @@ class MockRenderProcessHost : public content::RenderProcessHost {
DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHost);
};
-class MockRenderProcessHostFactory : public content::RenderProcessHostFactory {
+class MockRenderProcessHostFactory : public RenderProcessHostFactory {
public:
MockRenderProcessHostFactory();
virtual ~MockRenderProcessHostFactory();
- virtual content::RenderProcessHost* CreateRenderProcessHost(
- content::BrowserContext* browser_context) const OVERRIDE;
+ virtual RenderProcessHost* CreateRenderProcessHost(
+ BrowserContext* browser_context) const OVERRIDE;
// Removes the given MockRenderProcessHost from the MockRenderProcessHost list
// without deleting it. When a test deletes a MockRenderProcessHost, we need
@@ -120,4 +123,6 @@ class MockRenderProcessHostFactory : public content::RenderProcessHostFactory {
DISALLOW_COPY_AND_ASSIGN(MockRenderProcessHostFactory);
};
-#endif // CONTENT_BROWSER_RENDERER_HOST_MOCK_RENDER_PROCESS_HOST_H_
+} // namespace content
+
+#endif // CONTENT_TEST_MOCK_RENDER_PROCESS_HOST_H_
diff --git a/content/test/test_renderer_host.cc b/content/test/test_renderer_host.cc
index 14293b7..16dd6f1 100644
--- a/content/test/test_renderer_host.cc
+++ b/content/test/test_renderer_host.cc
@@ -4,12 +4,12 @@
#include "content/test/test_renderer_host.h"
-#include "content/browser/renderer_host/mock_render_process_host.h"
#include "content/browser/renderer_host/render_view_host_factory.h"
#include "content/browser/renderer_host/test_render_view_host.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/tab_contents/navigation_entry_impl.h"
#include "content/browser/tab_contents/test_tab_contents.h"
+#include "content/test/mock_render_process_host.h"
#include "content/test/test_browser_context.h"
#if defined(USE_AURA)
diff --git a/content/test/test_renderer_host.h b/content/test/test_renderer_host.h
index 25c12bd..51b8e0b 100644
--- a/content/test/test_renderer_host.h
+++ b/content/test/test_renderer_host.h
@@ -13,8 +13,6 @@
#include "testing/gtest/include/gtest/gtest.h"
class TestTabContents;
-class MockRenderProcessHost;
-class MockRenderProcessHostFactory;
#if defined(USE_AURA)
namespace aura {
@@ -28,6 +26,8 @@ class TestStackingClient;
namespace content {
class BrowserContext;
+class MockRenderProcessHost;
+class MockRenderProcessHostFactory;
class NavigationController;
class RenderProcessHostFactory;
class RenderViewHostDelegate;