Make sure webrtc::VideoSource is released when WebRtcVideoTrackAdapter is destroyed.
[chromium-blink-merge.git] / content / test / test_render_frame_host.h
blob318c78fa37ac73a1f908f53fcbb77b931cfb6d71
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 <vector>
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;
16 namespace content {
18 class TestRenderFrameHost : public RenderFrameHostImpl {
19 public:
20 TestRenderFrameHost(RenderViewHostImpl* render_view_host,
21 RenderFrameHostDelegate* delegate,
22 FrameTree* frame_tree,
23 FrameTreeNode* frame_tree_node,
24 int routing_id,
25 bool is_swapped_out);
26 virtual ~TestRenderFrameHost();
28 void SendNavigate(int page_id, const GURL& url);
29 void SendNavigateWithTransition(
30 int page_id,
31 const GURL& url,
32 PageTransition transition);
33 void SendFailedNavigate(int page_id, const GURL& url);
34 void SendNavigateWithTransitionAndResponseCode(
35 int page_id,
36 const GURL& url, PageTransition transition,
37 int response_code);
38 void SendNavigateWithOriginalRequestURL(
39 int page_id,
40 const GURL& url,
41 const GURL& original_request_url);
42 void SendNavigateWithFile(
43 int page_id,
44 const GURL& url,
45 const base::FilePath& file_path);
46 void SendNavigateWithParams(
47 FrameHostMsg_DidCommitProvisionalLoad_Params* params);
48 void SendNavigateWithRedirects(
49 int page_id,
50 const GURL& url,
51 const std::vector<GURL>& redirects);
52 void SendNavigateWithParameters(
53 int page_id,
54 const GURL& url,
55 PageTransition transition,
56 const GURL& original_request_url,
57 int response_code,
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
66 // RenderFrame
67 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared).
68 // False by default.
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
74 // here.
76 private:
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_