| OLD | NEW |
| 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 Loading... |
| 228 false, nullptr, nullptr); | 228 false, nullptr, nullptr); |
| 229 SendNavigateWithParams(¶ms); | 229 SendNavigateWithParams(¶ms); |
| 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 Loading... |
| 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 |
| OLD | NEW |