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_
10 #include "base/basictypes.h"
11 #include "content/browser/frame_host/render_frame_host_impl.h"
12 #include "content/public/common/page_transition_types.h"
14 struct FrameHostMsg_DidCommitProvisionalLoad_Params
;
18 class TestRenderFrameHost
: public RenderFrameHostImpl
{
20 TestRenderFrameHost(RenderViewHostImpl
* render_view_host
,
21 RenderFrameHostDelegate
* delegate
,
22 FrameTree
* frame_tree
,
23 FrameTreeNode
* frame_tree_node
,
26 virtual ~TestRenderFrameHost();
28 void SendNavigate(int page_id
, const GURL
& url
);
29 void SendNavigateWithTransition(
32 PageTransition transition
);
33 void SendFailedNavigate(int page_id
, const GURL
& url
);
34 void SendNavigateWithTransitionAndResponseCode(
36 const GURL
& url
, PageTransition transition
,
38 void SendNavigateWithOriginalRequestURL(
41 const GURL
& original_request_url
);
42 void SendNavigateWithFile(
45 const base::FilePath
& file_path
);
46 void SendNavigateWithParams(
47 FrameHostMsg_DidCommitProvisionalLoad_Params
* params
);
48 void SendNavigateWithRedirects(
51 const std::vector
<GURL
>& redirects
);
52 void SendNavigateWithParameters(
55 PageTransition transition
,
56 const GURL
& original_request_url
,
58 const base::FilePath
* file_path_for_history_item
,
59 const std::vector
<GURL
>& redirects
);
61 void set_contents_mime_type(const std::string
& mime_type
) {
62 contents_mime_type_
= mime_type
;
65 // If set, navigations will appear to have cleared the history list in the
67 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared).
69 void set_simulate_history_list_was_cleared(bool cleared
) {
70 simulate_history_list_was_cleared_
= cleared
;
73 // TODO(nick): As necessary for testing, override behavior of RenderFrameHost
77 std::string contents_mime_type_
;
79 // See set_simulate_history_list_was_cleared() above.
80 bool simulate_history_list_was_cleared_
;
82 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost
);
85 } // namespace content
87 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_