| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // If set, future loads will have |mime_type| set as the mime type. | 120 // If set, future loads will have |mime_type| set as the mime type. |
| 121 // If not set, the mime type will default to "text/html". | 121 // If not set, the mime type will default to "text/html". |
| 122 virtual void SetContentsMimeType(const std::string& mime_type) = 0; | 122 virtual void SetContentsMimeType(const std::string& mime_type) = 0; |
| 123 | 123 |
| 124 // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter. | 124 // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter. |
| 125 virtual void SendBeforeUnloadACK(bool proceed) = 0; | 125 virtual void SendBeforeUnloadACK(bool proceed) = 0; |
| 126 | 126 |
| 127 // Simulates the SwapOut_ACK that fires if you commit a cross-site | 127 // Simulates the SwapOut_ACK that fires if you commit a cross-site |
| 128 // navigation without making any network requests. | 128 // navigation without making any network requests. |
| 129 virtual void SimulateSwapOutACK() = 0; | 129 virtual void SimulateSwapOutACK() = 0; |
| 130 |
| 131 // Simulate a renderer-initiated navigation up until commit. |
| 132 virtual void NavigateAndCommitRendererInitiated(int page_id, |
| 133 bool did_create_new_entry, |
| 134 const GURL& url) = 0; |
| 130 }; | 135 }; |
| 131 | 136 |
| 132 // An interface and utility for driving tests of RenderViewHost. | 137 // An interface and utility for driving tests of RenderViewHost. |
| 133 class RenderViewHostTester { | 138 class RenderViewHostTester { |
| 134 public: | 139 public: |
| 135 // Retrieves the RenderViewHostTester that drives the specified | 140 // Retrieves the RenderViewHostTester that drives the specified |
| 136 // RenderViewHost. The RenderViewHost must have been created while | 141 // RenderViewHost. The RenderViewHost must have been created while |
| 137 // RenderViewHost testing was enabled; use a | 142 // RenderViewHost testing was enabled; use a |
| 138 // RenderViewHostTestEnabler instance (see below) to do this. | 143 // RenderViewHostTestEnabler instance (see below) to do this. |
| 139 static RenderViewHostTester* For(RenderViewHost* host); | 144 static RenderViewHostTester* For(RenderViewHost* host); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 std::unique_ptr<MockGpuChannelEstablishFactory> gpu_channel_factory_; | 286 std::unique_ptr<MockGpuChannelEstablishFactory> gpu_channel_factory_; |
| 282 #endif | 287 #endif |
| 283 RenderViewHostTestEnabler rvh_test_enabler_; | 288 RenderViewHostTestEnabler rvh_test_enabler_; |
| 284 | 289 |
| 285 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 290 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
| 286 }; | 291 }; |
| 287 | 292 |
| 288 } // namespace content | 293 } // namespace content |
| 289 | 294 |
| 290 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ | 295 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ |
| OLD | NEW |