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