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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // This removes the need to expose | 60 // This removes the need to expose |
61 // RenderFrameHostImpl::is_swapped_out() outside of content. | 61 // RenderFrameHostImpl::is_swapped_out() outside of content. |
62 // | 62 // |
63 // This is safe to call on any RenderFrameHost, not just ones | 63 // This is safe to call on any RenderFrameHost, not just ones |
64 // constructed while a RenderViewHostTestEnabler is in play. | 64 // constructed while a RenderViewHostTestEnabler is in play. |
65 static bool IsRenderFrameHostSwappedOut(RenderFrameHost* rfh); | 65 static bool IsRenderFrameHostSwappedOut(RenderFrameHost* rfh); |
66 | 66 |
67 virtual ~RenderFrameHostTester() {} | 67 virtual ~RenderFrameHostTester() {} |
68 | 68 |
| 69 // Simulates initialization of the RenderFrame object in the renderer process |
| 70 // and ensures internal state of RenderFrameHost is ready for simulating |
| 71 // RenderFrame originated IPCs. |
| 72 virtual void InitializeRenderFrameIfNeeded() = 0; |
| 73 |
69 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned | 74 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned |
70 // RenderFrameHost is owned by the parent RenderFrameHost. | 75 // RenderFrameHost is owned by the parent RenderFrameHost. |
71 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; | 76 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; |
72 | 77 |
73 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given | 78 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given |
74 // information with various sets of parameters. These are helper functions for | 79 // information with various sets of parameters. These are helper functions for |
75 // simulating the most common types of loads. | 80 // simulating the most common types of loads. |
76 // | 81 // |
77 // Guidance for calling these: | 82 // Guidance for calling these: |
78 // - nav_entry_id should be 0 if simulating a renderer-initiated navigation; | 83 // - nav_entry_id should be 0 if simulating a renderer-initiated navigation; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 261 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
257 #endif | 262 #endif |
258 RenderViewHostTestEnabler rvh_test_enabler_; | 263 RenderViewHostTestEnabler rvh_test_enabler_; |
259 | 264 |
260 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 265 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
261 }; | 266 }; |
262 | 267 |
263 } // namespace content | 268 } // namespace content |
264 | 269 |
265 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 270 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
OLD | NEW |