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

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

Issue 2735183003: PlzNavigate: stop navigations when opening a document for write (Closed)
Patch Set: Addressed commemts Created 3 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/renderer/render_frame_impl.cc ('k') | content/test/test_web_contents.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 #include "content/test/test_render_frame_host.h" 5 #include "content/test/test_render_frame_host.h"
6 6
7 #include "base/guid.h" 7 #include "base/guid.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "content/browser/frame_host/frame_tree.h" 9 #include "content/browser/frame_host/frame_tree.h"
10 #include "content/browser/frame_host/navigation_handle_impl.h" 10 #include "content/browser/frame_host/navigation_handle_impl.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 false, nullptr, nullptr); 228 false, nullptr, nullptr);
229 SendNavigateWithParams(&params); 229 SendNavigateWithParams(&params);
230 } 230 }
231 231
232 void TestRenderFrameHost::SimulateNavigationStop() { 232 void TestRenderFrameHost::SimulateNavigationStop() {
233 if (is_loading()) { 233 if (is_loading()) {
234 OnDidStopLoading(); 234 OnDidStopLoading();
235 } else if (IsBrowserSideNavigationEnabled()) { 235 } else if (IsBrowserSideNavigationEnabled()) {
236 // Even if the RenderFrameHost is not loading, there may still be an 236 // Even if the RenderFrameHost is not loading, there may still be an
237 // ongoing navigation in the FrameTreeNode. Cancel this one as well. 237 // ongoing navigation in the FrameTreeNode. Cancel this one as well.
238 frame_tree_node()->ResetNavigationRequest(false); 238 frame_tree_node()->ResetNavigationRequest(false, true);
239 } 239 }
240 } 240 }
241 241
242 void TestRenderFrameHost::SetContentsMimeType(const std::string& mime_type) { 242 void TestRenderFrameHost::SetContentsMimeType(const std::string& mime_type) {
243 contents_mime_type_ = mime_type; 243 contents_mime_type_ = mime_type;
244 } 244 }
245 245
246 void TestRenderFrameHost::SendBeforeUnloadACK(bool proceed) { 246 void TestRenderFrameHost::SendBeforeUnloadACK(bool proceed) {
247 base::TimeTicks now = base::TimeTicks::Now(); 247 base::TimeTicks now = base::TimeTicks::Now();
248 OnBeforeUnloadACK(proceed, now, now); 248 OnBeforeUnloadACK(proceed, now, now);
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at 520 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at
521 // this point. 521 // this point.
522 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) 522 if (!navigation_handle() || IsBrowserSideNavigationEnabled())
523 return; 523 return;
524 navigation_handle()->CallWillStartRequestForTesting( 524 navigation_handle()->CallWillStartRequestForTesting(
525 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), 525 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault),
526 true /* user_gesture */, transition, false /* is_external_protocol */); 526 true /* user_gesture */, transition, false /* is_external_protocol */);
527 } 527 }
528 528
529 } // namespace content 529 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/test/test_web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698