Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: content/test/test_render_frame_host.h

Issue 636673002: Remove navigation from TestRenderViewHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes from self-review Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_TEST_TEST_RENDER_FRAME_HOST_H_ 5 #ifndef CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_
6 #define CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ 6 #define CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 int routing_id, 42 int routing_id,
43 bool is_swapped_out); 43 bool is_swapped_out);
44 virtual ~TestRenderFrameHost(); 44 virtual ~TestRenderFrameHost();
45 45
46 // RenderFrameHostImpl overrides (same values, but in Test* types) 46 // RenderFrameHostImpl overrides (same values, but in Test* types)
47 virtual TestRenderViewHost* GetRenderViewHost() override; 47 virtual TestRenderViewHost* GetRenderViewHost() override;
48 48
49 // RenderFrameHostTester implementation. 49 // RenderFrameHostTester implementation.
50 virtual TestRenderFrameHost* AppendChild( 50 virtual TestRenderFrameHost* AppendChild(
51 const std::string& frame_name) override; 51 const std::string& frame_name) override;
52 virtual void SendNavigate(int page_id, const GURL& url) override;
53 virtual void SendFailedNavigate(int page_id, const GURL& url) override;
52 virtual void SendNavigateWithTransition( 54 virtual void SendNavigateWithTransition(
53 int page_id, 55 int page_id,
54 const GURL& url, 56 const GURL& url,
55 ui::PageTransition transition) override; 57 ui::PageTransition transition) override;
58 virtual void SetContentsMimeType(const std::string& mime_type) override;
56 virtual void SendBeforeUnloadACK(bool proceed) override; 59 virtual void SendBeforeUnloadACK(bool proceed) override;
57 virtual void SimulateSwapOutACK() override; 60 virtual void SimulateSwapOutACK() override;
58 61
59 void SendNavigate(int page_id, const GURL& url);
60 void SendFailedNavigate(int page_id, const GURL& url);
61 void SendNavigateWithTransitionAndResponseCode( 62 void SendNavigateWithTransitionAndResponseCode(
62 int page_id, 63 int page_id,
63 const GURL& url, ui::PageTransition transition, 64 const GURL& url, ui::PageTransition transition,
64 int response_code); 65 int response_code);
65 void SendNavigateWithOriginalRequestURL( 66 void SendNavigateWithOriginalRequestURL(
66 int page_id, 67 int page_id,
67 const GURL& url, 68 const GURL& url,
68 const GURL& original_request_url); 69 const GURL& original_request_url);
69 void SendNavigateWithFile( 70 void SendNavigateWithFile(
70 int page_id, 71 int page_id,
(...skipping 10 matching lines...) Expand all
81 const GURL& url, 82 const GURL& url,
82 ui::PageTransition transition, 83 ui::PageTransition transition,
83 const GURL& original_request_url, 84 const GURL& original_request_url,
84 int response_code, 85 int response_code,
85 const base::FilePath* file_path_for_history_item, 86 const base::FilePath* file_path_for_history_item,
86 const std::vector<GURL>& redirects); 87 const std::vector<GURL>& redirects);
87 void SendBeginNavigationWithURL(const GURL& url); 88 void SendBeginNavigationWithURL(const GURL& url);
88 89
89 void DidDisownOpener(); 90 void DidDisownOpener();
90 91
91 void set_contents_mime_type(const std::string& mime_type) {
92 contents_mime_type_ = mime_type;
93 }
94
95 // If set, navigations will appear to have cleared the history list in the 92 // If set, navigations will appear to have cleared the history list in the
96 // RenderFrame 93 // RenderFrame
97 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared). 94 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared).
98 // False by default. 95 // False by default.
99 void set_simulate_history_list_was_cleared(bool cleared) { 96 void set_simulate_history_list_was_cleared(bool cleared) {
100 simulate_history_list_was_cleared_ = cleared; 97 simulate_history_list_was_cleared_ = cleared;
101 } 98 }
102 99
103 // TODO(nick): As necessary for testing, override behavior of RenderFrameHost
104 // here.
105
106 private: 100 private:
107 TestRenderFrameHostCreationObserver child_creation_observer_; 101 TestRenderFrameHostCreationObserver child_creation_observer_;
108 102
109 std::string contents_mime_type_; 103 std::string contents_mime_type_;
110 104
111 // See set_simulate_history_list_was_cleared() above. 105 // See set_simulate_history_list_was_cleared() above.
112 bool simulate_history_list_was_cleared_; 106 bool simulate_history_list_was_cleared_;
113 107
114 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost); 108 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost);
115 }; 109 };
116 110
117 } // namespace content 111 } // namespace content
118 112
119 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ 113 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698