| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "content/public/browser/render_frame_host.h" | 15 #include "content/public/browser/render_frame_host.h" |
| 15 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
| 16 #include "content/public/test/test_browser_thread_bundle.h" | 17 #include "content/public/test/test_browser_thread_bundle.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "ui/base/page_transition_types.h" | 19 #include "ui/base/page_transition_types.h" |
| 19 | 20 |
| 20 #if defined(USE_AURA) | 21 #if defined(USE_AURA) |
| 21 #include "ui/aura/test/aura_test_helper.h" | 22 #include "ui/aura/test/aura_test_helper.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // RenderViewHostTester and RenderFrameHostTester respectively. | 173 // RenderViewHostTester and RenderFrameHostTester respectively. |
| 173 class RenderViewHostTestEnabler { | 174 class RenderViewHostTestEnabler { |
| 174 public: | 175 public: |
| 175 RenderViewHostTestEnabler(); | 176 RenderViewHostTestEnabler(); |
| 176 ~RenderViewHostTestEnabler(); | 177 ~RenderViewHostTestEnabler(); |
| 177 | 178 |
| 178 private: | 179 private: |
| 179 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestEnabler); | 180 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestEnabler); |
| 180 friend class RenderViewHostTestHarness; | 181 friend class RenderViewHostTestHarness; |
| 181 | 182 |
| 182 scoped_ptr<MockRenderProcessHostFactory> rph_factory_; | 183 std::unique_ptr<MockRenderProcessHostFactory> rph_factory_; |
| 183 scoped_ptr<TestRenderViewHostFactory> rvh_factory_; | 184 std::unique_ptr<TestRenderViewHostFactory> rvh_factory_; |
| 184 scoped_ptr<TestRenderFrameHostFactory> rfh_factory_; | 185 std::unique_ptr<TestRenderFrameHostFactory> rfh_factory_; |
| 185 }; | 186 }; |
| 186 | 187 |
| 187 // RenderViewHostTestHarness --------------------------------------------------- | 188 // RenderViewHostTestHarness --------------------------------------------------- |
| 188 class RenderViewHostTestHarness : public testing::Test { | 189 class RenderViewHostTestHarness : public testing::Test { |
| 189 public: | 190 public: |
| 190 RenderViewHostTestHarness(); | 191 RenderViewHostTestHarness(); |
| 191 ~RenderViewHostTestHarness() override; | 192 ~RenderViewHostTestHarness() override; |
| 192 | 193 |
| 193 NavigationController& controller(); | 194 NavigationController& controller(); |
| 194 | 195 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 261 |
| 261 #if defined(USE_AURA) | 262 #if defined(USE_AURA) |
| 262 aura::Window* root_window() { return aura_test_helper_->root_window(); } | 263 aura::Window* root_window() { return aura_test_helper_->root_window(); } |
| 263 #endif | 264 #endif |
| 264 | 265 |
| 265 // Replaces the RPH being used. | 266 // Replaces the RPH being used. |
| 266 void SetRenderProcessHostFactory(RenderProcessHostFactory* factory); | 267 void SetRenderProcessHostFactory(RenderProcessHostFactory* factory); |
| 267 | 268 |
| 268 private: | 269 private: |
| 269 int thread_bundle_options_; | 270 int thread_bundle_options_; |
| 270 scoped_ptr<TestBrowserThreadBundle> thread_bundle_; | 271 std::unique_ptr<TestBrowserThreadBundle> thread_bundle_; |
| 271 | 272 |
| 272 scoped_ptr<ContentBrowserSanityChecker> sanity_checker_; | 273 std::unique_ptr<ContentBrowserSanityChecker> sanity_checker_; |
| 273 | 274 |
| 274 scoped_ptr<BrowserContext> browser_context_; | 275 std::unique_ptr<BrowserContext> browser_context_; |
| 275 | 276 |
| 276 scoped_ptr<WebContents> contents_; | 277 std::unique_ptr<WebContents> contents_; |
| 277 #if defined(OS_WIN) | 278 #if defined(OS_WIN) |
| 278 scoped_ptr<ui::ScopedOleInitializer> ole_initializer_; | 279 std::unique_ptr<ui::ScopedOleInitializer> ole_initializer_; |
| 279 #endif | 280 #endif |
| 280 #if defined(USE_AURA) | 281 #if defined(USE_AURA) |
| 281 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 282 std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
| 282 #endif | 283 #endif |
| 283 RenderViewHostTestEnabler rvh_test_enabler_; | 284 RenderViewHostTestEnabler rvh_test_enabler_; |
| 284 | 285 |
| 285 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 286 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
| 286 }; | 287 }; |
| 287 | 288 |
| 288 } // namespace content | 289 } // namespace content |
| 289 | 290 |
| 290 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 291 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| OLD | NEW |