| 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 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| 11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 12 #include "content/public/common/page_transition_types.h" | 12 #include "content/public/common/page_transition_types.h" |
| 13 #include "content/public/test/test_browser_thread_bundle.h" | 13 #include "content/public/test/test_browser_thread_bundle.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 #if defined(USE_AURA) | 16 #if defined(USE_AURA) |
| 17 #include "ui/aura/test/aura_test_helper.h" | 17 #include "ui/wm/test/wm_test_helper.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace aura { | |
| 21 namespace test { | |
| 22 class AuraTestHelper; | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 namespace ui { | 20 namespace ui { |
| 27 class ScopedOleInitializer; | 21 class ScopedOleInitializer; |
| 28 } | 22 } |
| 29 | 23 |
| 30 namespace content { | 24 namespace content { |
| 31 | 25 |
| 32 class BrowserContext; | 26 class BrowserContext; |
| 33 class MockRenderProcessHost; | 27 class MockRenderProcessHost; |
| 34 class MockRenderProcessHostFactory; | 28 class MockRenderProcessHostFactory; |
| 35 class NavigationController; | 29 class NavigationController; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Configures which TestBrowserThreads inside |thread_bundle| are backed by | 164 // Configures which TestBrowserThreads inside |thread_bundle| are backed by |
| 171 // real threads. Must be called before SetUp(). | 165 // real threads. Must be called before SetUp(). |
| 172 void SetThreadBundleOptions(int options) { | 166 void SetThreadBundleOptions(int options) { |
| 173 DCHECK(thread_bundle_.get() == NULL); | 167 DCHECK(thread_bundle_.get() == NULL); |
| 174 thread_bundle_options_ = options; | 168 thread_bundle_options_ = options; |
| 175 } | 169 } |
| 176 | 170 |
| 177 TestBrowserThreadBundle* thread_bundle() { return thread_bundle_.get(); } | 171 TestBrowserThreadBundle* thread_bundle() { return thread_bundle_.get(); } |
| 178 | 172 |
| 179 #if defined(USE_AURA) | 173 #if defined(USE_AURA) |
| 180 aura::Window* root_window() { return aura_test_helper_->root_window(); } | 174 aura::Window* root_window() { return wm_test_helper_->root_window(); } |
| 181 #endif | 175 #endif |
| 182 | 176 |
| 183 // Replaces the RPH being used. | 177 // Replaces the RPH being used. |
| 184 void SetRenderProcessHostFactory(RenderProcessHostFactory* factory); | 178 void SetRenderProcessHostFactory(RenderProcessHostFactory* factory); |
| 185 | 179 |
| 186 private: | 180 private: |
| 187 scoped_ptr<BrowserContext> browser_context_; | 181 scoped_ptr<BrowserContext> browser_context_; |
| 188 | 182 |
| 189 // It is important not to use this directly in the implementation as | 183 // It is important not to use this directly in the implementation as |
| 190 // web_contents() and SetContents() are virtual and may be | 184 // web_contents() and SetContents() are virtual and may be |
| 191 // overridden by subclasses. | 185 // overridden by subclasses. |
| 192 scoped_ptr<WebContents> contents_; | 186 scoped_ptr<WebContents> contents_; |
| 193 #if defined(OS_WIN) | 187 #if defined(OS_WIN) |
| 194 scoped_ptr<ui::ScopedOleInitializer> ole_initializer_; | 188 scoped_ptr<ui::ScopedOleInitializer> ole_initializer_; |
| 195 #endif | 189 #endif |
| 196 #if defined(USE_AURA) | 190 #if defined(USE_AURA) |
| 197 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 191 scoped_ptr<wm::WMTestHelper> wm_test_helper_; |
| 198 #endif | 192 #endif |
| 199 RenderViewHostTestEnabler rvh_test_enabler_; | 193 RenderViewHostTestEnabler rvh_test_enabler_; |
| 200 | 194 |
| 201 int thread_bundle_options_; | 195 int thread_bundle_options_; |
| 202 scoped_ptr<TestBrowserThreadBundle> thread_bundle_; | 196 scoped_ptr<TestBrowserThreadBundle> thread_bundle_; |
| 203 | 197 |
| 204 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 198 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
| 205 }; | 199 }; |
| 206 | 200 |
| 207 } // namespace content | 201 } // namespace content |
| 208 | 202 |
| 209 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 203 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| OLD | NEW |