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

Unified Diff: content/test/test_render_frame.cc

Issue 2557223002: Fix subframe loads with RenderViewTest when PlzNavigate is enabled. (Closed)
Patch Set: nit Created 4 years 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 | « content/test/test_render_frame.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_frame.cc
diff --git a/content/test/test_render_frame.cc b/content/test/test_render_frame.cc
index f8ccea2d6de77dcbbb4e115e259acc209d6cff30..7682e3e01f780dc4c064a4d50ec74dbee22640ba 100644
--- a/content/test/test_render_frame.cc
+++ b/content/test/test_render_frame.cc
@@ -8,6 +8,7 @@
#include "content/common/resource_request_body_impl.h"
#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/resource_response.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
namespace content {
@@ -70,4 +71,18 @@ void TestRenderFrame::SetCompositionFromExistingText(
OnSetCompositionFromExistingText(start, end, underlines);
}
+blink::WebNavigationPolicy TestRenderFrame::decidePolicyForNavigation(
+ const blink::WebFrameClient::NavigationPolicyInfo& info) {
+ if (IsBrowserSideNavigationEnabled() &&
+ info.urlRequest.checkForBrowserSideNavigation() &&
ananta 2016/12/08 22:57:05 is this check correct? Should it be !checkforBrows
jam 2016/12/08 23:01:28 The purpose of this if statement is to disable plz
+ GetWebFrame()->parent() &&
+ info.form.isNull()) {
+ // RenderViewTest::LoadHTML already disables PlzNavigate for the main frame
+ // requests. However if the loaded html has a subframe, the WebURLRequest
+ // will be created inside Blink and it won't have this flag set.
+ info.urlRequest.setCheckForBrowserSideNavigation(false);
+ }
+ return RenderFrameImpl::decidePolicyForNavigation(info);
+}
+
} // namespace content
« no previous file with comments | « content/test/test_render_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698