1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_
6 #define CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_
8 #include "base/basictypes.h"
9 #include "content/browser/frame_host/render_frame_host_impl.h"
10 #include "content/public/common/page_transition_types.h"
12 struct FrameHostMsg_DidCommitProvisionalLoad_Params;
16 class TestRenderFrameHost : public RenderFrameHostImpl {
18 TestRenderFrameHost(RenderViewHostImpl* render_view_host,
19 RenderFrameHostDelegate* delegate,
20 FrameTree* frame_tree,
21 FrameTreeNode* frame_tree_node,
24 virtual ~TestRenderFrameHost();
26 void SendNavigate(int page_id, const GURL& url);
27 void SendNavigateWithTransition(
30 PageTransition transition);
31 void SendFailedNavigate(int page_id, const GURL& url);
32 void SendNavigateWithTransitionAndResponseCode(
34 const GURL& url, PageTransition transition,
36 void SendNavigateWithOriginalRequestURL(
39 const GURL& original_request_url);
40 void SendNavigateWithFile(
43 const base::FilePath& file_path);
44 void SendNavigateWithParams(
45 FrameHostMsg_DidCommitProvisionalLoad_Params* params);
46 void SendNavigateWithParameters(
49 PageTransition transition,
50 const GURL& original_request_url,
52 const base::FilePath* file_path_for_history_item);
54 void set_contents_mime_type(const std::string& mime_type) {
55 contents_mime_type_ = mime_type;
58 // If set, navigations will appear to have cleared the history list in the
60 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared).
62 void set_simulate_history_list_was_cleared(bool cleared) {
63 simulate_history_list_was_cleared_ = cleared;
66 // TODO(nick): As necessary for testing, override behavior of RenderFrameHost
70 std::string contents_mime_type_;
72 // See set_simulate_history_list_was_cleared() above.
73 bool simulate_history_list_was_cleared_;
75 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost);
78 } // namespace content
80 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_