OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSIONS_TEST_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSIONS_TEST_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSIONS_TEST_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSIONS_TEST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "content/public/test/test_renderer_host.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace content { | 14 namespace content { |
14 class BrowserContext; | 15 class BrowserContext; |
15 class ContentClient; | 16 class ContentClient; |
16 class ContentBrowserClient; | 17 class ContentBrowserClient; |
| 18 class RenderViewHostTestEnabler; |
17 } | 19 } |
18 | 20 |
19 namespace extensions { | 21 namespace extensions { |
20 class TestExtensionsBrowserClient; | 22 class TestExtensionsBrowserClient; |
21 | 23 |
22 // Base class for extensions module unit tests of browser process code. Sets up | 24 // Base class for extensions module unit tests of browser process code. Sets up |
23 // the content module and extensions module client interfaces. Initializes | 25 // the content module and extensions module client interfaces. Initializes |
24 // services for a browser context. | 26 // services for a browser context. |
25 // | 27 // |
26 // NOTE: Use this class only in extensions_unittests, not in Chrome unit_tests. | 28 // NOTE: Use this class only in extensions_unittests, not in Chrome unit_tests. |
(...skipping 19 matching lines...) Expand all Loading... |
46 void SetUp() override; | 48 void SetUp() override; |
47 void TearDown() override; | 49 void TearDown() override; |
48 | 50 |
49 private: | 51 private: |
50 // TODO(yoz): Add a NotificationService here; it's used widely enough. | 52 // TODO(yoz): Add a NotificationService here; it's used widely enough. |
51 scoped_ptr<content::ContentClient> content_client_; | 53 scoped_ptr<content::ContentClient> content_client_; |
52 scoped_ptr<content::ContentBrowserClient> content_browser_client_; | 54 scoped_ptr<content::ContentBrowserClient> content_browser_client_; |
53 scoped_ptr<content::BrowserContext> browser_context_; | 55 scoped_ptr<content::BrowserContext> browser_context_; |
54 scoped_ptr<TestExtensionsBrowserClient> extensions_browser_client_; | 56 scoped_ptr<TestExtensionsBrowserClient> extensions_browser_client_; |
55 | 57 |
| 58 // The existence of this object enables tests via |
| 59 // RenderViewHostTester. |
| 60 content::RenderViewHostTestEnabler rvh_test_enabler_; |
| 61 |
56 DISALLOW_COPY_AND_ASSIGN(ExtensionsTest); | 62 DISALLOW_COPY_AND_ASSIGN(ExtensionsTest); |
57 }; | 63 }; |
58 | 64 |
59 } // namespace extensions | 65 } // namespace extensions |
60 | 66 |
61 #endif // EXTENSIONS_BROWSER_EXTENSIONS_TEST_H_ | 67 #endif // EXTENSIONS_BROWSER_EXTENSIONS_TEST_H_ |
OLD | NEW |