Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: content/public/test/test_content_client_initializer.h

Issue 10479023: Simplify how Content*Client interfaces are created. Instead of depending on the embedder to know wh… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove unused function declaration Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CONTENT_PUBLIC_TEST_TEST_CONTENT_CLIENT_INITIALIZER_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_CONTENT_CLIENT_INITIALIZER_
6 #define CONTENT_PUBLIC_TEST_TEST_CONTENT_CLIENT_INITIALIZER_ 6 #define CONTENT_PUBLIC_TEST_TEST_CONTENT_CLIENT_INITIALIZER_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 11
12 class NotificationServiceImpl; 12 class NotificationServiceImpl;
13 13
14 namespace content { 14 namespace content {
15 15
16 class ContentClient; 16 class ContentClient;
17 class MockContentBrowserClient;
18 class MockRenderProcessHostFactory; 17 class MockRenderProcessHostFactory;
18 class TestContentBrowserClient;
19 class TestRenderViewHostFactory; 19 class TestRenderViewHostFactory;
20 20
21 // Initializes various objects needed to run unit tests that use content:: 21 // Initializes various objects needed to run unit tests that use content::
22 // objects. Currently this includes setting up the notification service, 22 // objects. Currently this includes setting up the notification service,
23 // creating and setting the content client and the content browser client. 23 // creating and setting the content client and the content browser client.
24 class TestContentClientInitializer { 24 class TestContentClientInitializer {
25 public: 25 public:
26 TestContentClientInitializer(); 26 TestContentClientInitializer();
27 ~TestContentClientInitializer(); 27 ~TestContentClientInitializer();
28 28
29 // Enables switching RenderViewHost creation to use the test version instead 29 // Enables switching RenderViewHost creation to use the test version instead
30 // of the real implementation. This will last throughout the lifetime of this 30 // of the real implementation. This will last throughout the lifetime of this
31 // class. 31 // class.
32 void CreateTestRenderViewHosts(); 32 void CreateTestRenderViewHosts();
33 33
34 private: 34 private:
35 scoped_ptr<NotificationServiceImpl> notification_service_; 35 scoped_ptr<NotificationServiceImpl> notification_service_;
36 scoped_ptr<ContentClient> content_client_; 36 scoped_ptr<ContentClient> content_client_;
37 scoped_ptr<MockContentBrowserClient> content_browser_client_; 37 scoped_ptr<TestContentBrowserClient> content_browser_client_;
38 scoped_ptr<content::MockRenderProcessHostFactory> rph_factory_; 38 scoped_ptr<content::MockRenderProcessHostFactory> rph_factory_;
39 scoped_ptr<TestRenderViewHostFactory> test_render_view_host_factory_; 39 scoped_ptr<TestRenderViewHostFactory> test_render_view_host_factory_;
40 40
41 DISALLOW_COPY_AND_ASSIGN(TestContentClientInitializer); 41 DISALLOW_COPY_AND_ASSIGN(TestContentClientInitializer);
42 }; 42 };
43 43
44 } // namespace content 44 } // namespace content
45 45
46 #endif // CONTENT_PUBLIC_TEST_TEST_CONTENT_CLIENT_INITIALIZER_ 46 #endif // CONTENT_PUBLIC_TEST_TEST_CONTENT_CLIENT_INITIALIZER_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698