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

Side by Side Diff: content/public/test/test_renderer_host.h

Issue 2898663002: Implement feature policy checks in the browser process (Closed)
Patch Set: Implement feature policy checks in the browser process Created 3 years, 6 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
« no previous file with comments | « content/public/common/content_features.cc ('k') | content/test/test_render_frame_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter. 132 // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter.
133 virtual void SendBeforeUnloadACK(bool proceed) = 0; 133 virtual void SendBeforeUnloadACK(bool proceed) = 0;
134 134
135 // Simulates the SwapOut_ACK that fires if you commit a cross-site 135 // Simulates the SwapOut_ACK that fires if you commit a cross-site
136 // navigation without making any network requests. 136 // navigation without making any network requests.
137 virtual void SimulateSwapOutACK() = 0; 137 virtual void SimulateSwapOutACK() = 0;
138 138
139 // Simulate a renderer-initiated navigation up until commit. 139 // Simulate a renderer-initiated navigation up until commit.
140 virtual void NavigateAndCommitRendererInitiated(bool did_create_new_entry, 140 virtual void NavigateAndCommitRendererInitiated(bool did_create_new_entry,
141 const GURL& url) = 0; 141 const GURL& url) = 0;
142
143 // Set the feature policy header for the RenderFrameHost for test. Currently
144 // this is limited to setting a whitelist for a single feature. This function
145 // can be generalized as needed. Setting a header policy should only be done
146 // once per navigation of the RFH.
147 virtual void SimulateFeaturePolicyHeader(
148 blink::WebFeaturePolicyFeature feature,
149 const std::vector<url::Origin>& whitelist) = 0;
142 }; 150 };
143 151
144 // An interface and utility for driving tests of RenderViewHost. 152 // An interface and utility for driving tests of RenderViewHost.
145 class RenderViewHostTester { 153 class RenderViewHostTester {
146 public: 154 public:
147 // Retrieves the RenderViewHostTester that drives the specified 155 // Retrieves the RenderViewHostTester that drives the specified
148 // RenderViewHost. The RenderViewHost must have been created while 156 // RenderViewHost. The RenderViewHost must have been created while
149 // RenderViewHost testing was enabled; use a 157 // RenderViewHost testing was enabled; use a
150 // RenderViewHostTestEnabler instance (see below) to do this. 158 // RenderViewHostTestEnabler instance (see below) to do this.
151 static RenderViewHostTester* For(RenderViewHost* host); 159 static RenderViewHostTester* For(RenderViewHost* host);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 #endif 301 #endif
294 std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_; 302 std::unique_ptr<RenderViewHostTestEnabler> rvh_test_enabler_;
295 RenderProcessHostFactory* factory_ = nullptr; 303 RenderProcessHostFactory* factory_ = nullptr;
296 304
297 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); 305 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness);
298 }; 306 };
299 307
300 } // namespace content 308 } // namespace content
301 309
302 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 310 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
OLDNEW
« no previous file with comments | « content/public/common/content_features.cc ('k') | content/test/test_render_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698