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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « content/test/test_render_frame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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.h" 5 #include "content/test/test_render_frame.h"
6 6
7 #include "content/common/navigation_params.h" 7 #include "content/common/navigation_params.h"
8 #include "content/common/resource_request_body_impl.h" 8 #include "content/common/resource_request_body_impl.h"
9 #include "content/public/common/browser_side_navigation_policy.h" 9 #include "content/public/common/browser_side_navigation_policy.h"
10 #include "content/public/common/resource_response.h" 10 #include "content/public/common/resource_response.h"
11 #include "third_party/WebKit/public/web/WebLocalFrame.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 // static 15 // static
15 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame( 16 RenderFrameImpl* TestRenderFrame::CreateTestRenderFrame(
16 const RenderFrameImpl::CreateParams& params) { 17 const RenderFrameImpl::CreateParams& params) {
17 return new TestRenderFrame(params); 18 return new TestRenderFrame(params);
18 } 19 }
19 20
20 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams& params) 21 TestRenderFrame::TestRenderFrame(const RenderFrameImpl::CreateParams& params)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 OnSetAccessibilityMode(new_mode); 64 OnSetAccessibilityMode(new_mode);
64 } 65 }
65 66
66 void TestRenderFrame::SetCompositionFromExistingText( 67 void TestRenderFrame::SetCompositionFromExistingText(
67 int start, 68 int start,
68 int end, 69 int end,
69 const std::vector<blink::WebCompositionUnderline>& underlines) { 70 const std::vector<blink::WebCompositionUnderline>& underlines) {
70 OnSetCompositionFromExistingText(start, end, underlines); 71 OnSetCompositionFromExistingText(start, end, underlines);
71 } 72 }
72 73
74 blink::WebNavigationPolicy TestRenderFrame::decidePolicyForNavigation(
75 const blink::WebFrameClient::NavigationPolicyInfo& info) {
76 if (IsBrowserSideNavigationEnabled() &&
77 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
78 GetWebFrame()->parent() &&
79 info.form.isNull()) {
80 // RenderViewTest::LoadHTML already disables PlzNavigate for the main frame
81 // requests. However if the loaded html has a subframe, the WebURLRequest
82 // will be created inside Blink and it won't have this flag set.
83 info.urlRequest.setCheckForBrowserSideNavigation(false);
84 }
85 return RenderFrameImpl::decidePolicyForNavigation(info);
86 }
87
73 } // namespace content 88 } // namespace content
OLDNEW
« 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