Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / content / public / test / test_content_client_initializer.cc
blob0c210d297e506d65b1bbd85f794cd14e5d5b2dd2
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
3 // found in the LICENSE file.
5 #include "content/public/test/test_content_client_initializer.h"
7 #include "content/browser/notification_service_impl.h"
8 #include "content/public/common/content_client.h"
9 #include "content/public/test/mock_render_process_host.h"
10 #include "content/test/test_content_browser_client.h"
11 #include "content/test/test_content_client.h"
12 #include "content/test/test_render_view_host_factory.h"
14 namespace content {
16 TestContentClientInitializer::TestContentClientInitializer() {
17 notification_service_.reset(new NotificationServiceImpl());
19 content_client_.reset(new TestContentClient);
20 SetContentClient(content_client_.get());
22 content_browser_client_.reset(new TestContentBrowserClient());
23 content::SetBrowserClientForTesting(content_browser_client_.get());
26 TestContentClientInitializer::~TestContentClientInitializer() {
27 test_render_view_host_factory_.reset();
28 rph_factory_.reset();
29 notification_service_.reset();
31 SetContentClient(NULL);
32 content_client_.reset();
34 content_browser_client_.reset();
37 void TestContentClientInitializer::CreateTestRenderViewHosts() {
38 #if !defined(OS_IOS)
39 rph_factory_.reset(new MockRenderProcessHostFactory());
40 test_render_view_host_factory_.reset(
41 new TestRenderViewHostFactory(rph_factory_.get()));
42 #endif // OS_IOS
45 } // namespace content