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

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

Issue 953503002: PlzNavigate: test updates post beforeUnload IPC refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comment updates. Created 5 years, 9 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
« no previous file with comments | « content/test/test_navigation_url_loader.cc ('k') | content/test/test_render_frame_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const GURL& url, 78 const GURL& url,
79 const std::vector<GURL>& redirects); 79 const std::vector<GURL>& redirects);
80 void SendNavigateWithParameters( 80 void SendNavigateWithParameters(
81 int page_id, 81 int page_id,
82 const GURL& url, 82 const GURL& url,
83 ui::PageTransition transition, 83 ui::PageTransition transition,
84 const GURL& original_request_url, 84 const GURL& original_request_url,
85 int response_code, 85 int response_code,
86 const base::FilePath* file_path_for_history_item, 86 const base::FilePath* file_path_for_history_item,
87 const std::vector<GURL>& redirects); 87 const std::vector<GURL>& redirects);
88 void SendBeginNavigationWithURL(const GURL& url, bool has_user_gesture); 88
89 // With the current navigation logic this method is a no-op.
90 // PlzNavigate: this method simulates receiving a BeginNavigation IPC.
91 void SendRendererInitiatedNavigationRequest(const GURL& url,
92 bool has_user_gesture);
89 93
90 void DidDisownOpener(); 94 void DidDisownOpener();
91 95
92 // If set, navigations will appear to have cleared the history list in the 96 // If set, navigations will appear to have cleared the history list in the
93 // RenderFrame 97 // RenderFrame
94 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared). 98 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared).
95 // False by default. 99 // False by default.
96 void set_simulate_history_list_was_cleared(bool cleared) { 100 void set_simulate_history_list_was_cleared(bool cleared) {
97 simulate_history_list_was_cleared_ = cleared; 101 simulate_history_list_was_cleared_ = cleared;
98 } 102 }
99 103
100 // Advances the RenderFrameHost (and through it the RenderFrameHostManager) to 104 // Advances the RenderFrameHost (and through it the RenderFrameHostManager) to
101 // a state where a new navigation can be committed by a renderer. Currently, 105 // a state where a new navigation can be committed by a renderer. Currently,
102 // this simulates a BeforeUnload ACK from the renderer. 106 // this simulates a BeforeUnload ACK from the renderer.
103 // PlzNavigate: this simulates a BeforeUnload ACK from the renderer, and the 107 // PlzNavigate: this simulates a BeforeUnload ACK from the renderer, and the
104 // interaction with the IO thread up until the response is ready to commit. 108 // interaction with the IO thread up until the response is ready to commit.
105 void PrepareForCommit(const GURL& url); 109 void PrepareForCommit();
110
111 // This method does the same as PrepareForCommit.
112 // PlzNavigate: Beyond doing the same as PrepareForCommit, this method will
113 // also simulate a server redirect to |redirect_url|. If the URL is empty the
114 // redirect step is ignored.
115 void PrepareForCommitWithServerRedirect(const GURL& redirect_url);
106 116
107 // Simulate receiving a FrameHostMsg_BeforeUnloadHandlersPresent. 117 // Simulate receiving a FrameHostMsg_BeforeUnloadHandlersPresent.
108 void SendBeforeUnloadHandlersPresent(bool present); 118 void SendBeforeUnloadHandlersPresent(bool present);
109 119
110 // Simulate receiving a FrameHostMsg_UnloadHandlersPresent. 120 // Simulate receiving a FrameHostMsg_UnloadHandlersPresent.
111 void SendUnloadHandlersPresent(bool present); 121 void SendUnloadHandlersPresent(bool present);
112 122
113 private: 123 private:
114 TestRenderFrameHostCreationObserver child_creation_observer_; 124 TestRenderFrameHostCreationObserver child_creation_observer_;
115 125
116 std::string contents_mime_type_; 126 std::string contents_mime_type_;
117 127
118 // See set_simulate_history_list_was_cleared() above. 128 // See set_simulate_history_list_was_cleared() above.
119 bool simulate_history_list_was_cleared_; 129 bool simulate_history_list_was_cleared_;
120 130
121 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost); 131 DISALLOW_COPY_AND_ASSIGN(TestRenderFrameHost);
122 }; 132 };
123 133
124 } // namespace content 134 } // namespace content
125 135
126 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_ 136 #endif // CONTENT_TEST_TEST_RENDER_FRAME_HOST_H_
OLDNEW
« no previous file with comments | « content/test/test_navigation_url_loader.cc ('k') | content/test/test_render_frame_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698