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

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

Issue 2696493003: Introduce SubframeNavigationFilteringThrottle (Closed)
Patch Set: s/proceed2/allowed2/ (trybots prev) Created 3 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
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 loop.QuitClosure()); 126 loop.QuitClosure());
127 loop.Run(); 127 loop.Run();
128 } 128 }
129 TestNavigationURLLoader* url_loader = 129 TestNavigationURLLoader* url_loader =
130 static_cast<TestNavigationURLLoader*>(request->loader_for_testing()); 130 static_cast<TestNavigationURLLoader*>(request->loader_for_testing());
131 CHECK(url_loader); 131 CHECK(url_loader);
132 url_loader->SimulateServerRedirect(new_url); 132 url_loader->SimulateServerRedirect(new_url);
133 return; 133 return;
134 } 134 }
135 135
136 navigation_handle()->CallWillRedirectRequestForTesting(new_url, false, GURL(), 136 navigation_handle()->CallWillRedirectRequestForTesting(
137 false); 137 new_url, false, GURL(), false,
138 content::NavigationHandle::ThrottleChecksFinishedCallback());
138 } 139 }
139 140
140 void TestRenderFrameHost::SimulateNavigationCommit(const GURL& url) { 141 void TestRenderFrameHost::SimulateNavigationCommit(const GURL& url) {
141 if (frame_tree_node()->navigation_request()) 142 if (frame_tree_node()->navigation_request())
142 PrepareForCommit(); 143 PrepareForCommit();
143 144
144 bool is_auto_subframe = 145 bool is_auto_subframe =
145 GetParent() && !frame_tree_node()->has_committed_real_load(); 146 GetParent() && !frame_tree_node()->has_committed_real_load();
146 147
147 FrameHostMsg_DidCommitProvisionalLoad_Params params; 148 FrameHostMsg_DidCommitProvisionalLoad_Params params;
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 } 515 }
515 516
516 void TestRenderFrameHost::SimulateWillStartRequest( 517 void TestRenderFrameHost::SimulateWillStartRequest(
517 ui::PageTransition transition) { 518 ui::PageTransition transition) {
518 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at 519 // PlzNavigate: NavigationHandle::WillStartRequest has already been called at
519 // this point. 520 // this point.
520 if (!navigation_handle() || IsBrowserSideNavigationEnabled()) 521 if (!navigation_handle() || IsBrowserSideNavigationEnabled())
521 return; 522 return;
522 navigation_handle()->CallWillStartRequestForTesting( 523 navigation_handle()->CallWillStartRequestForTesting(
523 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), 524 false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault),
524 true /* user_gesture */, transition, false /* is_external_protocol */); 525 true /* user_gesture */, transition, false /* is_external_protocol */,
526 content::NavigationHandle::ThrottleChecksFinishedCallback());
525 } 527 }
526 528
527 } // namespace content 529 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698