Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 SetFeaturePolicyHeader( | |
|
alexmos
2017/05/30 20:37:57
nit: SimulateFeaturePolicyHeader might be more con
raymes
2017/05/31 07:07:54
Done.
| |
| 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 Loading... | |
| 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_ |
| OLD | NEW |