| 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> | 10 #include <memory> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 // An interface and utility for driving tests of RenderFrameHost. | 52 // An interface and utility for driving tests of RenderFrameHost. |
| 53 class RenderFrameHostTester { | 53 class RenderFrameHostTester { |
| 54 public: | 54 public: |
| 55 // Retrieves the RenderFrameHostTester that drives the specified | 55 // Retrieves the RenderFrameHostTester that drives the specified |
| 56 // RenderFrameHost. The RenderFrameHost must have been created while | 56 // RenderFrameHost. The RenderFrameHost must have been created while |
| 57 // RenderFrameHost testing was enabled; use a | 57 // RenderFrameHost testing was enabled; use a |
| 58 // RenderViewHostTestEnabler instance (see below) to do this. | 58 // RenderViewHostTestEnabler instance (see below) to do this. |
| 59 static RenderFrameHostTester* For(RenderFrameHost* host); | 59 static RenderFrameHostTester* For(RenderFrameHost* host); |
| 60 | 60 |
| 61 // Calls the RenderFrameHost's private OnMessageReceived function with the |
| 62 // given message. |
| 63 static bool TestOnMessageReceived(RenderFrameHost* rfh, |
| 64 const IPC::Message& msg); |
| 65 |
| 61 static void CommitPendingLoad(NavigationController* controller); | 66 static void CommitPendingLoad(NavigationController* controller); |
| 62 | 67 |
| 63 virtual ~RenderFrameHostTester() {} | 68 virtual ~RenderFrameHostTester() {} |
| 64 | 69 |
| 65 // Simulates initialization of the RenderFrame object in the renderer process | 70 // Simulates initialization of the RenderFrame object in the renderer process |
| 66 // and ensures internal state of RenderFrameHost is ready for simulating | 71 // and ensures internal state of RenderFrameHost is ready for simulating |
| 67 // RenderFrame originated IPCs. | 72 // RenderFrame originated IPCs. |
| 68 virtual void InitializeRenderFrameIfNeeded() = 0; | 73 virtual void InitializeRenderFrameIfNeeded() = 0; |
| 69 | 74 |
| 70 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned | 75 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 #endif | 307 #endif |
| 303 std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_; | 308 std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_; |
| 304 RenderProcessHostFactory* factory_ = nullptr; | 309 RenderProcessHostFactory* factory_ = nullptr; |
| 305 | 310 |
| 306 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 311 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
| 307 }; | 312 }; |
| 308 | 313 |
| 309 } // namespace content | 314 } // namespace content |
| 310 | 315 |
| 311 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 316 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| OLD | NEW |