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 "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // RenderViewHostTestEnabler instance (see below) to do this. | 54 // RenderViewHostTestEnabler instance (see below) to do this. |
55 static RenderFrameHostTester* For(RenderFrameHost* host); | 55 static RenderFrameHostTester* For(RenderFrameHost* host); |
56 | 56 |
57 // If the given NavigationController has a pending main frame, returns it, | 57 // If the given NavigationController has a pending main frame, returns it, |
58 // otherwise NULL. This is an alternative to | 58 // otherwise NULL. This is an alternative to |
59 // WebContentsTester::GetPendingMainFrame() when your WebContents was not | 59 // WebContentsTester::GetPendingMainFrame() when your WebContents was not |
60 // created via a TestWebContents. | 60 // created via a TestWebContents. |
61 static RenderFrameHost* GetPendingForController( | 61 static RenderFrameHost* GetPendingForController( |
62 NavigationController* controller); | 62 NavigationController* controller); |
63 | 63 |
64 // This removes the need to expose | |
65 // RenderFrameHostImpl::is_swapped_out() outside of content. | |
66 // | |
67 // This is safe to call on any RenderFrameHost, not just ones | |
68 // constructed while a RenderViewHostTestEnabler is in play. | |
69 static bool IsRenderFrameHostSwappedOut(RenderFrameHost* rfh); | |
70 | |
71 virtual ~RenderFrameHostTester() {} | 64 virtual ~RenderFrameHostTester() {} |
72 | 65 |
73 // Simulates initialization of the RenderFrame object in the renderer process | 66 // Simulates initialization of the RenderFrame object in the renderer process |
74 // and ensures internal state of RenderFrameHost is ready for simulating | 67 // and ensures internal state of RenderFrameHost is ready for simulating |
75 // RenderFrame originated IPCs. | 68 // RenderFrame originated IPCs. |
76 virtual void InitializeRenderFrameIfNeeded() = 0; | 69 virtual void InitializeRenderFrameIfNeeded() = 0; |
77 | 70 |
78 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned | 71 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned |
79 // RenderFrameHost is owned by the parent RenderFrameHost. | 72 // RenderFrameHost is owned by the parent RenderFrameHost. |
80 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; | 73 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 281 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
289 #endif | 282 #endif |
290 RenderViewHostTestEnabler rvh_test_enabler_; | 283 RenderViewHostTestEnabler rvh_test_enabler_; |
291 | 284 |
292 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 285 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
293 }; | 286 }; |
294 | 287 |
295 } // namespace content | 288 } // namespace content |
296 | 289 |
297 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 290 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
OLD | NEW |