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

Side by Side Diff: content/browser/frame_host/navigator_impl_unittest.cc

Issue 912833002: PlzNavigate: update Navigator tests post-removal of the RequestNavigation IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor changes from CR comments. Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "content/browser/frame_host/navigation_controller_impl.h" 8 #include "content/browser/frame_host/navigation_controller_impl.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 9 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/frame_host/navigation_request.h" 10 #include "content/browser/frame_host/navigation_request.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 static_cast<MockRenderProcessHost*>(rfh->GetProcess()); 93 static_cast<MockRenderProcessHost*>(rfh->GetProcess());
94 const FrameMsg_CommitNavigation* commit_message = 94 const FrameMsg_CommitNavigation* commit_message =
95 static_cast<const FrameMsg_CommitNavigation*>( 95 static_cast<const FrameMsg_CommitNavigation*>(
96 rph->sink().GetUniqueMessageMatching( 96 rph->sink().GetUniqueMessageMatching(
97 FrameMsg_CommitNavigation::ID)); 97 FrameMsg_CommitNavigation::ID));
98 return commit_message && 98 return commit_message &&
99 rfh->GetRoutingID() == commit_message->routing_id(); 99 rfh->GetRoutingID() == commit_message->routing_id();
100 } 100 }
101 }; 101 };
102 102
103 // PlzNavigate: Test final state after a complete navigation (to avoid repeating 103 // PlzNavigate: Test a complete browser-initiated navigation starting with a
104 // these checks in other tests). 104 // non-live renderer.
nasko 2015/02/11 19:22:22 Do we have a test for the same, but starting with
carlosk 2015/02/11 19:54:29 Yes, there's others below starting from a live one
105 TEST_F(NavigatorTestWithBrowserSideNavigation, NavigationFinishedState) { 105 TEST_F(NavigatorTestWithBrowserSideNavigation,
106 SimpleBrowserInitiatedNavigationFromNonLiveRenderer) {
106 const GURL kUrl("http://chromium.org/"); 107 const GURL kUrl("http://chromium.org/");
107 contents()->NavigateAndCommit(kUrl); 108
108 ASSERT_TRUE(main_test_rfh()); 109 EXPECT_FALSE(main_test_rfh()->IsRenderFrameLive());
nasko 2015/02/11 19:22:22 Note: I wonder if this will conflict in functional
carlosk 2015/02/11 19:54:29 Acknowledged.
110
111 // Start a browser-initiated navigation.
112 int32 site_instance_id = main_test_rfh()->GetSiteInstance()->GetId();
113 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
114 SendRequestNavigation(node, kUrl);
nasko 2015/02/11 19:22:22 Shouldn't this method name change? We no longer se
carlosk 2015/02/11 19:54:29 Indeed Send* seemed to imply an IPC that doesn't e
115 NavigationRequest* request = GetNavigationRequestForFrameTreeNode(node);
116 ASSERT_TRUE(request);
117 EXPECT_EQ(kUrl, request->common_params().url);
118 EXPECT_TRUE(request->browser_initiated());
119
120 // As there's no live renderer the navigation should not wait for a
121 // beforeUnload ACK from the renderer and start right away.
122 EXPECT_EQ(NavigationRequest::STARTED, request->state());
123 ASSERT_TRUE(GetLoaderForNavigationRequest(request));
124 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
125 EXPECT_FALSE(node->render_manager()->pending_frame_host());
126
127 // Have the current RenderFrameHost commit the navigation.
128 scoped_refptr<ResourceResponse> response(new ResourceResponse);
129 GetLoaderForNavigationRequest(request)
130 ->CallOnResponseStarted(response, MakeEmptyStream());
131 EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh()));
132 EXPECT_EQ(NavigationRequest::RESPONSE_STARTED, request->state());
133
134 // The navigation commits.
135 main_test_rfh()->SendNavigate(0, kUrl);
109 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state()); 136 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state());
110 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl), 137 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl),
111 main_test_rfh()->GetSiteInstance()->GetSiteURL()); 138 main_test_rfh()->GetSiteInstance()->GetSiteURL());
112 EXPECT_EQ(kUrl, contents()->GetLastCommittedURL()); 139 EXPECT_EQ(kUrl, contents()->GetLastCommittedURL());
140 EXPECT_FALSE(GetNavigationRequestForFrameTreeNode(node));
141 EXPECT_FALSE(node->render_manager()->pending_frame_host());
142
143 // The main RFH should not have been changed, and the renderer should have
144 // been initialized.
145 EXPECT_EQ(site_instance_id, main_test_rfh()->GetSiteInstance()->GetId());
146 EXPECT_TRUE(main_test_rfh()->IsRenderFrameLive());
113 147
114 // After a navigation is finished no speculative RenderFrameHost should 148 // After a navigation is finished no speculative RenderFrameHost should
115 // exist. 149 // exist.
116 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
117 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); 150 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
118 151
119 // With PlzNavigate enabled a pending RenderFrameHost should never exist. 152 // With PlzNavigate enabled a pending RenderFrameHost should never exist.
120 EXPECT_FALSE(node->render_manager()->pending_frame_host()); 153 EXPECT_FALSE(node->render_manager()->pending_frame_host());
121 } 154 }
122 155
156 // PlzNavigate: Test a complete renderer-initiated navigation starting with a
157 // non-live renderer.
nasko 2015/02/11 19:22:22 I'll echo clamy@'s comment here. How do we start a
carlosk 2015/02/11 19:54:29 Done.
158 TEST_F(NavigatorTestWithBrowserSideNavigation,
159 SimpleRendererInitiatedNavigation) {
160 const GURL kUrl("http://chromium.org/");
161
162 EXPECT_FALSE(main_test_rfh()->IsRenderFrameLive());
163
164 // Start a renderer-initiated navigation.
165 main_test_rfh()->SendBeginNavigationWithURL(kUrl);
166 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
167 NavigationRequest* request = GetNavigationRequestForFrameTreeNode(node);
168 ASSERT_TRUE(request);
169 EXPECT_EQ(kUrl, request->common_params().url);
170 EXPECT_FALSE(request->browser_initiated());
171 EXPECT_EQ(NavigationRequest::STARTED, request->state());
172 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
173
174 // Have the current RenderFrameHost commit the navigation.
175 scoped_refptr<ResourceResponse> response(new ResourceResponse);
176 GetLoaderForNavigationRequest(request)
177 ->CallOnResponseStarted(response, MakeEmptyStream());
178 EXPECT_TRUE(DidRenderFrameHostRequestCommit(main_test_rfh()));
179 EXPECT_EQ(NavigationRequest::RESPONSE_STARTED, request->state());
180
181 // The navigation commits.
182 main_test_rfh()->SendNavigate(0, kUrl);
183 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state());
184 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl),
185 main_test_rfh()->GetSiteInstance()->GetSiteURL());
186 EXPECT_EQ(kUrl, contents()->GetLastCommittedURL());
187 EXPECT_FALSE(GetNavigationRequestForFrameTreeNode(node));
188 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
189 EXPECT_FALSE(node->render_manager()->pending_frame_host());
190 }
191
192 // PlzNavigate: Test that a beforeUnload denial cancels the navigation.
193 TEST_F(NavigatorTestWithBrowserSideNavigation,
194 BeforeUnloadDenialCancelNavigation) {
195 const GURL kUrl1("http://www.google.com/");
196 const GURL kUrl2("http://www.chromium.org/");
197
198 contents()->NavigateAndCommit(kUrl1);
199
200 // Start a new navigation.
201 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
202 SendRequestNavigation(node, kUrl2);
203 NavigationRequest* request = GetNavigationRequestForFrameTreeNode(node);
204 ASSERT_TRUE(request);
205 EXPECT_TRUE(request->browser_initiated());
206 EXPECT_EQ(NavigationRequest::WAITING_FOR_RENDERER_RESPONSE, request->state());
207 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
208
209 // Simulate a beforeUnload denial.
210 main_test_rfh()->SendBeforeUnloadACK(false);
211 EXPECT_FALSE(GetNavigationRequestForFrameTreeNode(node));
212 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
213 }
214
123 // PlzNavigate: Test that a proper NavigationRequest is created by 215 // PlzNavigate: Test that a proper NavigationRequest is created by
124 // BeginNavigation. 216 // RequestNavigation.
125 // Note that all PlzNavigate methods on the browser side require the use of the
126 // flag kEnableBrowserSideNavigation.
127 TEST_F(NavigatorTestWithBrowserSideNavigation, BeginNavigation) { 217 TEST_F(NavigatorTestWithBrowserSideNavigation, BeginNavigation) {
128 const GURL kUrl1("http://www.google.com/"); 218 const GURL kUrl1("http://www.google.com/");
129 const GURL kUrl2("http://www.chromium.org/"); 219 const GURL kUrl2("http://www.chromium.org/");
130 const GURL kUrl3("http://www.gmail.com/"); 220 const GURL kUrl3("http://www.gmail.com/");
131 221
132 contents()->NavigateAndCommit(kUrl1); 222 contents()->NavigateAndCommit(kUrl1);
133 223
134 // Add a subframe. 224 // Add a subframe.
135 FrameTreeNode* root_node = contents()->GetFrameTree()->root(); 225 FrameTreeNode* root_node = contents()->GetFrameTree()->root();
136 TestRenderFrameHost* subframe_rfh = main_test_rfh()->AppendChild("Child"); 226 TestRenderFrameHost* subframe_rfh = main_test_rfh()->AppendChild("Child");
137 ASSERT_TRUE(subframe_rfh); 227 ASSERT_TRUE(subframe_rfh);
138 228
229 // Start a navigation at the subframe.
139 FrameTreeNode* subframe_node = subframe_rfh->frame_tree_node(); 230 FrameTreeNode* subframe_node = subframe_rfh->frame_tree_node();
140 SendRequestNavigation(subframe_node, kUrl2); 231 SendRequestNavigation(subframe_node, kUrl2);
141 // There is no previous renderer in the subframe, so BeginNavigation is
142 // handled already.
143 NavigationRequest* subframe_request = 232 NavigationRequest* subframe_request =
144 GetNavigationRequestForFrameTreeNode(subframe_node); 233 GetNavigationRequestForFrameTreeNode(subframe_node);
145 TestNavigationURLLoader* subframe_loader = 234 TestNavigationURLLoader* subframe_loader =
146 GetLoaderForNavigationRequest(subframe_request); 235 GetLoaderForNavigationRequest(subframe_request);
236
237 // Subframe navigations should start right away as they don't have to request
238 // beforeUnload to run at the renderer.
nasko 2015/02/11 19:22:22 FYI, this might change in the future.
carlosk 2015/02/11 19:54:29 Yes, I am aware. :) See my last comment reply in
147 ASSERT_TRUE(subframe_request); 239 ASSERT_TRUE(subframe_request);
240 ASSERT_TRUE(subframe_loader);
241 EXPECT_EQ(NavigationRequest::STARTED, subframe_request->state());
148 EXPECT_EQ(kUrl2, subframe_request->common_params().url); 242 EXPECT_EQ(kUrl2, subframe_request->common_params().url);
149 EXPECT_EQ(kUrl2, subframe_loader->request_info()->common_params.url); 243 EXPECT_EQ(kUrl2, subframe_loader->request_info()->common_params.url);
150 // First party for cookies url should be that of the main frame. 244 // First party for cookies url should be that of the main frame.
151 EXPECT_EQ(kUrl1, subframe_loader->request_info()->first_party_for_cookies); 245 EXPECT_EQ(kUrl1, subframe_loader->request_info()->first_party_for_cookies);
152 EXPECT_FALSE(subframe_loader->request_info()->is_main_frame); 246 EXPECT_FALSE(subframe_loader->request_info()->is_main_frame);
153 EXPECT_TRUE(subframe_loader->request_info()->parent_is_main_frame); 247 EXPECT_TRUE(subframe_loader->request_info()->parent_is_main_frame);
248 EXPECT_TRUE(subframe_request->browser_initiated());
154 EXPECT_FALSE(GetSpeculativeRenderFrameHost(root_node)); 249 EXPECT_FALSE(GetSpeculativeRenderFrameHost(root_node));
155 250
156 // Subframe navigations should never create a speculative RenderFrameHost, 251 // Subframe navigations should never create a speculative RenderFrameHost,
157 // unless site-per-process is enabled. In that case, as the subframe 252 // unless site-per-process is enabled. In that case, as the subframe
158 // navigation is to a different site and is still ongoing, it should have one. 253 // navigation is to a different site and is still ongoing, it should have one.
159 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 254 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
160 switches::kSitePerProcess)) { 255 switches::kSitePerProcess)) {
161 EXPECT_TRUE(GetSpeculativeRenderFrameHost(subframe_node)); 256 EXPECT_TRUE(GetSpeculativeRenderFrameHost(subframe_node));
162 } else { 257 } else {
163 EXPECT_FALSE(GetSpeculativeRenderFrameHost(subframe_node)); 258 EXPECT_FALSE(GetSpeculativeRenderFrameHost(subframe_node));
164 } 259 }
165 260
261 // Now start a navigation at the root node.
166 SendRequestNavigation(root_node, kUrl3); 262 SendRequestNavigation(root_node, kUrl3);
167 // Simulate a BeginNavigation IPC on the main frame.
168 main_test_rfh()->SendBeginNavigationWithURL(kUrl3);
169 NavigationRequest* main_request = 263 NavigationRequest* main_request =
170 GetNavigationRequestForFrameTreeNode(root_node); 264 GetNavigationRequestForFrameTreeNode(root_node);
265 ASSERT_TRUE(main_request);
266 EXPECT_EQ(NavigationRequest::WAITING_FOR_RENDERER_RESPONSE,
267 main_request->state());
268 EXPECT_FALSE(GetSpeculativeRenderFrameHost(root_node));
269
270 // Simulate a BeforeUnloadACK IPC on the main frame.
271 main_test_rfh()->SendBeforeUnloadACK(true);
171 TestNavigationURLLoader* main_loader = 272 TestNavigationURLLoader* main_loader =
172 GetLoaderForNavigationRequest(main_request); 273 GetLoaderForNavigationRequest(main_request);
173 ASSERT_TRUE(main_request);
174 EXPECT_EQ(kUrl3, main_request->common_params().url); 274 EXPECT_EQ(kUrl3, main_request->common_params().url);
175 EXPECT_EQ(kUrl3, main_loader->request_info()->common_params.url); 275 EXPECT_EQ(kUrl3, main_loader->request_info()->common_params.url);
176 EXPECT_EQ(kUrl3, main_loader->request_info()->first_party_for_cookies); 276 EXPECT_EQ(kUrl3, main_loader->request_info()->first_party_for_cookies);
177 EXPECT_TRUE(main_loader->request_info()->is_main_frame); 277 EXPECT_TRUE(main_loader->request_info()->is_main_frame);
178 EXPECT_FALSE(main_loader->request_info()->parent_is_main_frame); 278 EXPECT_FALSE(main_loader->request_info()->parent_is_main_frame);
279 EXPECT_TRUE(main_request->browser_initiated());
280 // BeforeUnloadACK was received from the renderer so the navigation should
281 // have started.
282 EXPECT_EQ(NavigationRequest::STARTED, main_request->state());
179 283
180 // Main frame navigation to a different site should use a speculative 284 // Main frame navigation to a different site should use a speculative
181 // RenderFrameHost. 285 // RenderFrameHost.
182 EXPECT_TRUE(GetSpeculativeRenderFrameHost(root_node)); 286 EXPECT_TRUE(GetSpeculativeRenderFrameHost(root_node));
183 287
184 // As the main frame hasn't yet committed the subframe still exists. Thus, the 288 // As the main frame hasn't yet committed the subframe still exists. Thus, the
185 // above situation regarding subframe navigations is valid here. 289 // above situation regarding subframe navigations is valid here.
186 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 290 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
187 switches::kSitePerProcess)) { 291 switches::kSitePerProcess)) {
188 EXPECT_TRUE(GetSpeculativeRenderFrameHost(subframe_node)); 292 EXPECT_TRUE(GetSpeculativeRenderFrameHost(subframe_node));
189 } else { 293 } else {
190 EXPECT_FALSE(GetSpeculativeRenderFrameHost(subframe_node)); 294 EXPECT_FALSE(GetSpeculativeRenderFrameHost(subframe_node));
191 } 295 }
192 } 296 }
193 297
194 // PlzNavigate: Test that RequestNavigation creates a NavigationRequest and that
195 // RenderFrameHost is not modified when the navigation commits.
196 TEST_F(NavigatorTestWithBrowserSideNavigation, NoLiveRenderer) {
197 const GURL kUrl("http://www.google.com/");
198
199 EXPECT_FALSE(main_test_rfh()->render_view_host()->IsRenderViewLive());
200 RenderFrameHostImpl* rfh = main_test_rfh();
201 FrameTreeNode* node = rfh->frame_tree_node();
202 SendRequestNavigation(node, kUrl);
203
204 // A NavigationRequest should have been generated.
205 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node);
206 EXPECT_TRUE(main_request != NULL);
207
208 // Since we're re-using the current RenderFrameHost, no speculative one should
209 // be created.
210 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
211
212 // Now return the response without any redirects. This will cause the
213 // navigation to commit at the same URL.
214 scoped_refptr<ResourceResponse> response(new ResourceResponse);
215 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted(
216 response, MakeEmptyStream());
217 main_request = GetNavigationRequestForFrameTreeNode(node);
218
219 // The main RFH should not have been changed, and the renderer should have
220 // been initialized.
221 EXPECT_EQ(rfh, main_test_rfh());
222 EXPECT_TRUE(main_test_rfh()->IsRenderFrameLive());
223 EXPECT_TRUE(main_test_rfh()->render_view_host()->IsRenderViewLive());
224 }
225
226 // PlzNavigate: Test that committing an HTTP 204 or HTTP 205 response cancels 298 // PlzNavigate: Test that committing an HTTP 204 or HTTP 205 response cancels
227 // the navigation. 299 // the navigation.
228 TEST_F(NavigatorTestWithBrowserSideNavigation, NoContent) { 300 TEST_F(NavigatorTestWithBrowserSideNavigation, NoContent) {
229 const GURL kUrl1("http://www.chromium.org/"); 301 const GURL kUrl1("http://www.chromium.org/");
230 const GURL kUrl2("http://www.google.com/"); 302 const GURL kUrl2("http://www.google.com/");
231 303
232 // Load a URL. 304 // Load a URL.
233 contents()->NavigateAndCommit(kUrl1); 305 contents()->NavigateAndCommit(kUrl1);
234 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); 306 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
235 307
236 // Navigate to a different site. 308 // Navigate to a different site.
237 process()->sink().ClearMessages(); 309 process()->sink().ClearMessages();
238 SendRequestNavigation(node, kUrl2); 310 SendRequestNavigation(node, kUrl2);
239 main_test_rfh()->SendBeginNavigationWithURL(kUrl2); 311 main_test_rfh()->SendBeforeUnloadACK(true);
240 312
241 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node); 313 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node);
242 ASSERT_TRUE(main_request); 314 ASSERT_TRUE(main_request);
243 315
244 // Navigations to a different site do create a speculative RenderFrameHost. 316 // Navigations to a different site do create a speculative RenderFrameHost.
245 EXPECT_TRUE(GetSpeculativeRenderFrameHost(node)); 317 EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
246 318
247 // Commit an HTTP 204 response. 319 // Commit an HTTP 204 response.
248 scoped_refptr<ResourceResponse> response(new ResourceResponse); 320 scoped_refptr<ResourceResponse> response(new ResourceResponse);
249 const char kNoContentHeaders[] = "HTTP/1.1 204 No Content\0\0"; 321 const char kNoContentHeaders[] = "HTTP/1.1 204 No Content\0\0";
250 response->head.headers = new net::HttpResponseHeaders( 322 response->head.headers = new net::HttpResponseHeaders(
251 std::string(kNoContentHeaders, arraysize(kNoContentHeaders))); 323 std::string(kNoContentHeaders, arraysize(kNoContentHeaders)));
252 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted( 324 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted(
253 response, MakeEmptyStream()); 325 response, MakeEmptyStream());
254 326
255 // There should be no pending nor speculative RenderFrameHost; the navigation 327 // There should be no pending nor speculative RenderFrameHost; the navigation
256 // was aborted. 328 // was aborted.
257 EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); 329 EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh()));
258 EXPECT_FALSE(GetNavigationRequestForFrameTreeNode(node)); 330 EXPECT_FALSE(GetNavigationRequestForFrameTreeNode(node));
259 EXPECT_FALSE(node->render_manager()->pending_frame_host()); 331 EXPECT_FALSE(node->render_manager()->pending_frame_host());
260 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); 332 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
261 333
262 // Now, repeat the test with 205 Reset Content. 334 // Now, repeat the test with 205 Reset Content.
263 335
264 // Navigate to a different site again. 336 // Navigate to a different site again.
265 process()->sink().ClearMessages(); 337 process()->sink().ClearMessages();
266 SendRequestNavigation(node, kUrl2); 338 SendRequestNavigation(node, kUrl2);
267 main_test_rfh()->SendBeginNavigationWithURL(kUrl2); 339 main_test_rfh()->SendBeforeUnloadACK(true);
268 340
269 main_request = GetNavigationRequestForFrameTreeNode(node); 341 main_request = GetNavigationRequestForFrameTreeNode(node);
270 ASSERT_TRUE(main_request); 342 ASSERT_TRUE(main_request);
271 EXPECT_TRUE(GetSpeculativeRenderFrameHost(node)); 343 EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
272 344
273 // Commit an HTTP 205 response. 345 // Commit an HTTP 205 response.
274 response = new ResourceResponse; 346 response = new ResourceResponse;
275 const char kResetContentHeaders[] = "HTTP/1.1 205 Reset Content\0\0"; 347 const char kResetContentHeaders[] = "HTTP/1.1 205 Reset Content\0\0";
276 response->head.headers = new net::HttpResponseHeaders( 348 response->head.headers = new net::HttpResponseHeaders(
277 std::string(kResetContentHeaders, arraysize(kResetContentHeaders))); 349 std::string(kResetContentHeaders, arraysize(kResetContentHeaders)));
(...skipping 14 matching lines...) Expand all
292 const GURL kUrl1("http://www.chromium.org/"); 364 const GURL kUrl1("http://www.chromium.org/");
293 const GURL kUrl2("http://www.google.com/"); 365 const GURL kUrl2("http://www.google.com/");
294 366
295 contents()->NavigateAndCommit(kUrl1); 367 contents()->NavigateAndCommit(kUrl1);
296 RenderFrameHostImpl* initial_rfh = main_test_rfh(); 368 RenderFrameHostImpl* initial_rfh = main_test_rfh();
297 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); 369 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
298 370
299 // Navigate to a different site. 371 // Navigate to a different site.
300 process()->sink().ClearMessages(); 372 process()->sink().ClearMessages();
301 SendRequestNavigation(node, kUrl2); 373 SendRequestNavigation(node, kUrl2);
302 main_test_rfh()->SendBeginNavigationWithURL(kUrl2); 374 main_test_rfh()->SendBeforeUnloadACK(true);
303 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node); 375 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node);
304 ASSERT_TRUE(main_request); 376 ASSERT_TRUE(main_request);
305 EXPECT_TRUE(GetSpeculativeRenderFrameHost(node)); 377 EXPECT_TRUE(GetSpeculativeRenderFrameHost(node));
306 378
307 scoped_refptr<ResourceResponse> response(new ResourceResponse); 379 scoped_refptr<ResourceResponse> response(new ResourceResponse);
308 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted( 380 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted(
309 response, MakeEmptyStream()); 381 response, MakeEmptyStream());
310 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node); 382 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node);
311 ASSERT_TRUE(speculative_rfh); 383 ASSERT_TRUE(speculative_rfh);
312 EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_rfh)); 384 EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_rfh));
(...skipping 15 matching lines...) Expand all
328 const GURL kUrl1("http://www.chromium.org/"); 400 const GURL kUrl1("http://www.chromium.org/");
329 const GURL kUrl2("http://www.google.com/"); 401 const GURL kUrl2("http://www.google.com/");
330 402
331 contents()->NavigateAndCommit(kUrl1); 403 contents()->NavigateAndCommit(kUrl1);
332 RenderFrameHostImpl* rfh = main_test_rfh(); 404 RenderFrameHostImpl* rfh = main_test_rfh();
333 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); 405 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
334 406
335 // Navigate to a URL on the same site. 407 // Navigate to a URL on the same site.
336 process()->sink().ClearMessages(); 408 process()->sink().ClearMessages();
337 SendRequestNavigation(node, kUrl1); 409 SendRequestNavigation(node, kUrl1);
338 main_test_rfh()->SendBeginNavigationWithURL(kUrl1); 410 main_test_rfh()->SendBeforeUnloadACK(true);
339 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node); 411 NavigationRequest* main_request = GetNavigationRequestForFrameTreeNode(node);
340 ASSERT_TRUE(main_request); 412 ASSERT_TRUE(main_request);
341 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); 413 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
342 414
343 // It then redirects to another site. 415 // It then redirects to another site.
344 net::RedirectInfo redirect_info; 416 net::RedirectInfo redirect_info;
345 redirect_info.status_code = 302; 417 redirect_info.status_code = 302;
346 redirect_info.new_method = "GET"; 418 redirect_info.new_method = "GET";
347 redirect_info.new_url = kUrl2; 419 redirect_info.new_url = kUrl2;
348 redirect_info.new_first_party_for_cookies = kUrl2; 420 redirect_info.new_first_party_for_cookies = kUrl2;
349 scoped_refptr<ResourceResponse> response(new ResourceResponse); 421 scoped_refptr<ResourceResponse> response(new ResourceResponse);
350 GetLoaderForNavigationRequest(main_request)->CallOnRequestRedirected( 422 GetLoaderForNavigationRequest(main_request)->CallOnRequestRedirected(
351 redirect_info, response); 423 redirect_info, response);
352 424
353 // The redirect should have been followed. 425 // The redirect should have been followed.
354 EXPECT_EQ(1, GetLoaderForNavigationRequest(main_request)->redirect_count()); 426 EXPECT_EQ(1, GetLoaderForNavigationRequest(main_request)->redirect_count());
355 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); 427 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
356 428
357 // Request the RenderFrameHost to commit. 429 // Request the RenderFrameHost to commit.
358 response = new ResourceResponse; 430 response = new ResourceResponse;
359 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted( 431 GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted(
360 response, MakeEmptyStream()); 432 response, MakeEmptyStream());
361 TestRenderFrameHost* final_speculative_rfh = 433 TestRenderFrameHost* final_speculative_rfh =
362 GetSpeculativeRenderFrameHost(node); 434 GetSpeculativeRenderFrameHost(node);
363 EXPECT_TRUE(final_speculative_rfh); 435 EXPECT_TRUE(final_speculative_rfh);
364 EXPECT_TRUE(DidRenderFrameHostRequestCommit(final_speculative_rfh)); 436 EXPECT_TRUE(DidRenderFrameHostRequestCommit(final_speculative_rfh));
365 437
366 // And commit provisional load. 438 // The navigation commits.
367 final_speculative_rfh->SendNavigate(0, kUrl2); 439 final_speculative_rfh->SendNavigate(0, kUrl2);
368 RenderFrameHostImpl* final_rfh = main_test_rfh(); 440 RenderFrameHostImpl* final_rfh = main_test_rfh();
369 ASSERT_TRUE(final_rfh); 441 ASSERT_TRUE(final_rfh);
370 EXPECT_NE(rfh, final_rfh); 442 EXPECT_NE(rfh, final_rfh);
371 EXPECT_EQ(final_speculative_rfh, final_rfh); 443 EXPECT_EQ(final_speculative_rfh, final_rfh);
372 EXPECT_TRUE(final_rfh->IsRenderFrameLive()); 444 EXPECT_TRUE(final_rfh->IsRenderFrameLive());
373 EXPECT_TRUE(final_rfh->render_view_host()->IsRenderViewLive()); 445 EXPECT_TRUE(final_rfh->render_view_host()->IsRenderViewLive());
374 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node)); 446 EXPECT_FALSE(GetSpeculativeRenderFrameHost(node));
375 } 447 }
376 448
377 // PlzNavigate: Test that a navigation is canceled if another request has been 449 // PlzNavigate: Test that a navigation is canceled if another browser-initiated
378 // issued in the meantime. Also confirms that the speculative RenderFrameHost is 450 // request has been issued in the meantime. Also confirms that the speculative
379 // correctly updated in the process. 451 // RenderFrameHost is correctly updated in the process.
380 TEST_F(NavigatorTestWithBrowserSideNavigation, ReplacePendingNavigation) { 452 TEST_F(NavigatorTestWithBrowserSideNavigation,
453 BrowserInitiatedNavigationCancel) {
381 const GURL kUrl0("http://www.wikipedia.org/"); 454 const GURL kUrl0("http://www.wikipedia.org/");
382 const GURL kUrl1("http://www.chromium.org/"); 455 const GURL kUrl1("http://www.chromium.org/");
383 const GURL kUrl1_site = SiteInstance::GetSiteForURL(browser_context(), kUrl1); 456 const GURL kUrl1_site = SiteInstance::GetSiteForURL(browser_context(), kUrl1);
384 const GURL kUrl2("http://www.google.com/"); 457 const GURL kUrl2("http://www.google.com/");
385 const GURL kUrl2_site = SiteInstance::GetSiteForURL(browser_context(), kUrl2); 458 const GURL kUrl2_site = SiteInstance::GetSiteForURL(browser_context(), kUrl2);
386 459
387 // Initialization. 460 // Initialization.
388 contents()->NavigateAndCommit(kUrl0); 461 contents()->NavigateAndCommit(kUrl0);
389 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); 462 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
390 463
391 // Request navigation to the 1st URL. 464 // Request navigation to the 1st URL.
392 process()->sink().ClearMessages(); 465 process()->sink().ClearMessages();
393 SendRequestNavigation(node, kUrl1); 466 SendRequestNavigation(node, kUrl1);
394 main_test_rfh()->SendBeginNavigationWithURL(kUrl1); 467 main_test_rfh()->SendBeforeUnloadACK(true);
395 NavigationRequest* request1 = GetNavigationRequestForFrameTreeNode(node); 468 NavigationRequest* request1 = GetNavigationRequestForFrameTreeNode(node);
396 ASSERT_TRUE(request1); 469 ASSERT_TRUE(request1);
397 EXPECT_EQ(kUrl1, request1->common_params().url); 470 EXPECT_EQ(kUrl1, request1->common_params().url);
471 EXPECT_TRUE(request1->browser_initiated());
398 base::WeakPtr<TestNavigationURLLoader> loader1 = 472 base::WeakPtr<TestNavigationURLLoader> loader1 =
399 GetLoaderForNavigationRequest(request1)->AsWeakPtr(); 473 GetLoaderForNavigationRequest(request1)->AsWeakPtr();
400 474
401 // Confirm a speculative RFH was created. 475 // Confirm a speculative RFH was created.
402 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node); 476 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node);
403 ASSERT_TRUE(speculative_rfh); 477 ASSERT_TRUE(speculative_rfh);
404 int32 site_instance_id_1 = speculative_rfh->GetSiteInstance()->GetId(); 478 int32 site_instance_id_1 = speculative_rfh->GetSiteInstance()->GetId();
405 EXPECT_EQ(kUrl1_site, speculative_rfh->GetSiteInstance()->GetSiteURL()); 479 EXPECT_EQ(kUrl1_site, speculative_rfh->GetSiteInstance()->GetSiteURL());
406 480
407 // Request navigation to the 2nd URL; the NavigationRequest must have been 481 // Request navigation to the 2nd URL; the NavigationRequest must have been
408 // replaced by a new one with a different URL. 482 // replaced by a new one with a different URL.
409 SendRequestNavigation(node, kUrl2); 483 SendRequestNavigation(node, kUrl2);
410 main_test_rfh()->SendBeginNavigationWithURL(kUrl2); 484 main_test_rfh()->SendBeforeUnloadACK(true);
411 NavigationRequest* request2 = GetNavigationRequestForFrameTreeNode(node); 485 NavigationRequest* request2 = GetNavigationRequestForFrameTreeNode(node);
412 ASSERT_TRUE(request2); 486 ASSERT_TRUE(request2);
413 EXPECT_EQ(kUrl2, request2->common_params().url); 487 EXPECT_EQ(kUrl2, request2->common_params().url);
488 EXPECT_TRUE(request2->browser_initiated());
414 489
415 // Confirm that the first loader got destroyed. 490 // Confirm that the first loader got destroyed.
416 EXPECT_FALSE(loader1); 491 EXPECT_FALSE(loader1);
417 492
418 // Confirm that a new speculative RFH was created. 493 // Confirm that a new speculative RFH was created.
419 speculative_rfh = GetSpeculativeRenderFrameHost(node); 494 speculative_rfh = GetSpeculativeRenderFrameHost(node);
420 ASSERT_TRUE(speculative_rfh); 495 ASSERT_TRUE(speculative_rfh);
421 int32 site_instance_id_2 = speculative_rfh->GetSiteInstance()->GetId(); 496 int32 site_instance_id_2 = speculative_rfh->GetSiteInstance()->GetId();
422 EXPECT_NE(site_instance_id_1, site_instance_id_2); 497 EXPECT_NE(site_instance_id_1, site_instance_id_2);
423 498
424 // Request the RenderFrameHost to commit. 499 // Request the RenderFrameHost to commit.
425 scoped_refptr<ResourceResponse> response(new ResourceResponse); 500 scoped_refptr<ResourceResponse> response(new ResourceResponse);
426 GetLoaderForNavigationRequest(request2)->CallOnResponseStarted( 501 GetLoaderForNavigationRequest(request2)->CallOnResponseStarted(
427 response, MakeEmptyStream()); 502 response, MakeEmptyStream());
428 EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_rfh)); 503 EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_rfh));
429 EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); 504 EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh()));
430 505
431 // And commit provisional load. 506 // The navigation commits.
nasko 2015/02/11 19:22:22 nit: Let's match the style of the rest of the comm
carlosk 2015/02/11 19:54:28 Done here and in a few other tests.
432 speculative_rfh->SendNavigate(0, kUrl2); 507 speculative_rfh->SendNavigate(0, kUrl2);
433 508
434 // Confirm that the commit corresponds to the new request. 509 // Confirm that the commit corresponds to the new request.
435 ASSERT_TRUE(main_test_rfh()); 510 ASSERT_TRUE(main_test_rfh());
436 EXPECT_EQ(kUrl2_site, main_test_rfh()->GetSiteInstance()->GetSiteURL()); 511 EXPECT_EQ(kUrl2_site, main_test_rfh()->GetSiteInstance()->GetSiteURL());
437 EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL()); 512 EXPECT_EQ(kUrl2, contents()->GetLastCommittedURL());
438 513
439 // Confirm that the committed RFH is the latest speculative one. 514 // Confirm that the committed RFH is the latest speculative one.
440 EXPECT_EQ(site_instance_id_2, main_test_rfh()->GetSiteInstance()->GetId()); 515 EXPECT_EQ(site_instance_id_2, main_test_rfh()->GetSiteInstance()->GetId());
441 } 516 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 SpeculativeRendererWorksBaseCase) { 557 SpeculativeRendererWorksBaseCase) {
483 // Navigate to an initial site. 558 // Navigate to an initial site.
484 const GURL kUrlInit("http://wikipedia.org/"); 559 const GURL kUrlInit("http://wikipedia.org/");
485 contents()->NavigateAndCommit(kUrlInit); 560 contents()->NavigateAndCommit(kUrlInit);
486 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); 561 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
487 562
488 // Begin navigating to another site. 563 // Begin navigating to another site.
489 const GURL kUrl("http://google.com/"); 564 const GURL kUrl("http://google.com/");
490 process()->sink().ClearMessages(); 565 process()->sink().ClearMessages();
491 SendRequestNavigation(node, kUrl); 566 SendRequestNavigation(node, kUrl);
492 main_test_rfh()->SendBeginNavigationWithURL(kUrl); 567 main_test_rfh()->SendBeforeUnloadACK(true);
493 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node); 568 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node);
494 ASSERT_TRUE(speculative_rfh); 569 ASSERT_TRUE(speculative_rfh);
495 EXPECT_NE(speculative_rfh, main_test_rfh()); 570 EXPECT_NE(speculative_rfh, main_test_rfh());
496 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl), 571 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl),
497 speculative_rfh->GetSiteInstance()->GetSiteURL()); 572 speculative_rfh->GetSiteInstance()->GetSiteURL());
498 EXPECT_FALSE(node->render_manager()->pending_frame_host()); 573 EXPECT_FALSE(node->render_manager()->pending_frame_host());
499 int32 site_instance_id = speculative_rfh->GetSiteInstance()->GetId(); 574 int32 site_instance_id = speculative_rfh->GetSiteInstance()->GetId();
500 575
501 // Ask Navigator to commit the navigation by simulating a call to 576 // Ask Navigator to commit the navigation by simulating a call to
502 // OnResponseStarted. 577 // OnResponseStarted.
(...skipping 20 matching lines...) Expand all
523 // Navigate to an initial site. 598 // Navigate to an initial site.
524 const GURL kUrlInit("http://wikipedia.org/"); 599 const GURL kUrlInit("http://wikipedia.org/");
525 contents()->NavigateAndCommit(kUrlInit); 600 contents()->NavigateAndCommit(kUrlInit);
526 FrameTreeNode* node = main_test_rfh()->frame_tree_node(); 601 FrameTreeNode* node = main_test_rfh()->frame_tree_node();
527 int32 init_site_instance_id = main_test_rfh()->GetSiteInstance()->GetId(); 602 int32 init_site_instance_id = main_test_rfh()->GetSiteInstance()->GetId();
528 603
529 // Begin navigating to another site. 604 // Begin navigating to another site.
530 const GURL kUrl("http://google.com/"); 605 const GURL kUrl("http://google.com/");
531 process()->sink().ClearMessages(); 606 process()->sink().ClearMessages();
532 SendRequestNavigation(node, kUrl); 607 SendRequestNavigation(node, kUrl);
533 main_test_rfh()->SendBeginNavigationWithURL(kUrl); 608 main_test_rfh()->SendBeforeUnloadACK(true);
534 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node); 609 TestRenderFrameHost* speculative_rfh = GetSpeculativeRenderFrameHost(node);
535 int32 site_instance_id = speculative_rfh->GetSiteInstance()->GetId(); 610 int32 site_instance_id = speculative_rfh->GetSiteInstance()->GetId();
536 EXPECT_NE(init_site_instance_id, site_instance_id); 611 EXPECT_NE(init_site_instance_id, site_instance_id);
537 EXPECT_EQ(init_site_instance_id, main_test_rfh()->GetSiteInstance()->GetId()); 612 EXPECT_EQ(init_site_instance_id, main_test_rfh()->GetSiteInstance()->GetId());
538 ASSERT_TRUE(speculative_rfh); 613 ASSERT_TRUE(speculative_rfh);
539 EXPECT_NE(speculative_rfh, main_test_rfh()); 614 EXPECT_NE(speculative_rfh, main_test_rfh());
540 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl), 615 EXPECT_EQ(SiteInstanceImpl::GetSiteForURL(browser_context(), kUrl),
541 speculative_rfh->GetSiteInstance()->GetSiteURL()); 616 speculative_rfh->GetSiteInstance()->GetSiteURL());
542 617
543 // It then redirects to yet another site. 618 // It then redirects to yet another site.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state()); 688 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, main_test_rfh()->rfh_state());
614 EXPECT_TRUE(rfhm->IsOnSwappedOutList(rfh1)); 689 EXPECT_TRUE(rfhm->IsOnSwappedOutList(rfh1));
615 690
616 // Now go back to the initial site so that the swapped out RenderFrameHost 691 // Now go back to the initial site so that the swapped out RenderFrameHost
617 // should be reused. 692 // should be reused.
618 process()->sink().ClearMessages(); 693 process()->sink().ClearMessages();
619 static_cast<MockRenderProcessHost*>(rfh1->GetProcess()) 694 static_cast<MockRenderProcessHost*>(rfh1->GetProcess())
620 ->sink() 695 ->sink()
621 .ClearMessages(); 696 .ClearMessages();
622 SendRequestNavigation(node, kUrl1); 697 SendRequestNavigation(node, kUrl1);
623 main_test_rfh()->SendBeginNavigationWithURL(kUrl1); 698 main_test_rfh()->SendBeforeUnloadACK(true);
624 EXPECT_EQ(rfh1, GetSpeculativeRenderFrameHost(node)); 699 EXPECT_EQ(rfh1, GetSpeculativeRenderFrameHost(node));
625 EXPECT_NE(RenderFrameHostImpl::STATE_DEFAULT, 700 EXPECT_NE(RenderFrameHostImpl::STATE_DEFAULT,
626 GetSpeculativeRenderFrameHost(node)->rfh_state()); 701 GetSpeculativeRenderFrameHost(node)->rfh_state());
627 702
628 scoped_refptr<ResourceResponse> response(new ResourceResponse); 703 scoped_refptr<ResourceResponse> response(new ResourceResponse);
629 GetLoaderForNavigationRequest(GetNavigationRequestForFrameTreeNode(node)) 704 GetLoaderForNavigationRequest(GetNavigationRequestForFrameTreeNode(node))
630 ->CallOnResponseStarted(response, MakeEmptyStream()); 705 ->CallOnResponseStarted(response, MakeEmptyStream());
631 EXPECT_EQ(rfh1, GetSpeculativeRenderFrameHost(node)); 706 EXPECT_EQ(rfh1, GetSpeculativeRenderFrameHost(node));
632 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, 707 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT,
633 GetSpeculativeRenderFrameHost(node)->rfh_state()); 708 GetSpeculativeRenderFrameHost(node)->rfh_state());
634 EXPECT_TRUE(DidRenderFrameHostRequestCommit(rfh1)); 709 EXPECT_TRUE(DidRenderFrameHostRequestCommit(rfh1));
635 EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); 710 EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh()));
636 711
637 rfh1->SendNavigate(1, kUrl1); 712 rfh1->SendNavigate(1, kUrl1);
638 EXPECT_EQ(rfh1, main_test_rfh()); 713 EXPECT_EQ(rfh1, main_test_rfh());
639 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state()); 714 EXPECT_EQ(RenderFrameHostImpl::STATE_DEFAULT, rfh1->rfh_state());
640 EXPECT_FALSE(rfhm->IsOnSwappedOutList(rfh1)); 715 EXPECT_FALSE(rfhm->IsOnSwappedOutList(rfh1));
641 } 716 }
642 717
643 } // namespace content 718 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698