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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned | 69 // Gives tests access to RenderFrameHostImpl::OnCreateChild. The returned |
70 // RenderFrameHost is owned by the parent RenderFrameHost. | 70 // RenderFrameHost is owned by the parent RenderFrameHost. |
71 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; | 71 virtual RenderFrameHost* AppendChild(const std::string& frame_name) = 0; |
72 | 72 |
73 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given | 73 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given |
74 // information with various sets of parameters. These are helper functions for | 74 // information. Sets the rest of the parameters in the message to the |
75 // simulating the most common types of loads. | 75 // "typical" values. This is a helper function for simulating the most common |
76 // | 76 // types of loads. |
77 // Guidance for calling these: | 77 virtual void SendNavigate(int page_id, const GURL& url) = 0; |
78 // - nav_entry_id should be 0 if simulating a renderer-initiated navigation; | 78 virtual void SendFailedNavigate(int page_id, const GURL& url) = 0; |
79 // if simulating a browser-initiated one, pass the GetUniqueID() value of | 79 |
80 // the NavigationController's PendingEntry. | 80 // Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given |
81 // - did_create_new_entry should be true if simulating a navigation that | 81 // information, including a custom PageTransition. Sets the rest of the |
82 // created a new navigation entry; false for history navigations, reloads, | 82 // parameters in the message to the "typical" values. This is a helper |
83 // and other navigations that don't affect the history list. | 83 // function for simulating the most common types of loads. |
84 virtual void SendNavigate(int page_id, | |
85 int nav_entry_id, | |
86 bool did_create_new_entry, | |
87 const GURL& url) = 0; | |
88 virtual void SendFailedNavigate(int page_id, | |
89 int nav_entry_id, | |
90 bool did_create_new_entry, | |
91 const GURL& url) = 0; | |
92 virtual void SendNavigateWithTransition(int page_id, | 84 virtual void SendNavigateWithTransition(int page_id, |
93 int nav_entry_id, | |
94 bool did_create_new_entry, | |
95 const GURL& url, | 85 const GURL& url, |
96 ui::PageTransition transition) = 0; | 86 ui::PageTransition transition) = 0; |
97 | 87 |
98 // If set, future loads will have |mime_type| set as the mime type. | 88 // If set, future loads will have |mime_type| set as the mime type. |
99 // If not set, the mime type will default to "text/html". | 89 // If not set, the mime type will default to "text/html". |
100 virtual void SetContentsMimeType(const std::string& mime_type) = 0; | 90 virtual void SetContentsMimeType(const std::string& mime_type) = 0; |
101 | 91 |
102 // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter. | 92 // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter. |
103 virtual void SendBeforeUnloadACK(bool proceed) = 0; | 93 virtual void SendBeforeUnloadACK(bool proceed) = 0; |
104 | 94 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 246 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
257 #endif | 247 #endif |
258 RenderViewHostTestEnabler rvh_test_enabler_; | 248 RenderViewHostTestEnabler rvh_test_enabler_; |
259 | 249 |
260 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 250 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
261 }; | 251 }; |
262 | 252 |
263 } // namespace content | 253 } // namespace content |
264 | 254 |
265 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 255 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
OLD | NEW |