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

Unified Diff: components/test_runner/web_frame_test_client.cc

Issue 2680453004: PlzNavigate: avoid checking navigation policy twice for render-init requests. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/web_frame_test_client.cc
diff --git a/components/test_runner/web_frame_test_client.cc b/components/test_runner/web_frame_test_client.cc
index ca0aa871cf8c7080239684ef9614ce313809b63e..75c5d88245480fffb2c0c5eac2592b748311dcfa 100644
--- a/components/test_runner/web_frame_test_client.cc
+++ b/components/test_runner/web_frame_test_client.cc
@@ -657,6 +657,13 @@ void WebFrameTestClient::didAddMessageToConsole(
blink::WebNavigationPolicy WebFrameTestClient::decidePolicyForNavigation(
const blink::WebFrameClient::NavigationPolicyInfo& info) {
+ // PlzNavigate
+ // Navigation requests initiated by the renderer have checked navigation
+ // policy when the navigation was sent to the browser. Some layout tests
+ // expect that navigation policy is only checked once.
+ if (delegate_->IsNavigationInitiatedByRenderer(info.urlRequest))
+ return info.defaultPolicy;
+
if (test_runner()->shouldDumpNavigationPolicy()) {
delegate_->PrintMessage("Default policy for navigation to '" +
URLDescription(info.urlRequest.url()) + "' is '" +
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698