| 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_TEST_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 RenderViewHostDelegate* delegate, | 219 RenderViewHostDelegate* delegate, |
| 220 RenderWidgetHostDelegate* widget_delegate, | 220 RenderWidgetHostDelegate* widget_delegate, |
| 221 int routing_id, | 221 int routing_id, |
| 222 int main_frame_routing_id, | 222 int main_frame_routing_id, |
| 223 bool swapped_out); | 223 bool swapped_out); |
| 224 virtual ~TestRenderViewHost(); | 224 virtual ~TestRenderViewHost(); |
| 225 | 225 |
| 226 // RenderViewHostTester implementation. Note that CreateRenderView | 226 // RenderViewHostTester implementation. Note that CreateRenderView |
| 227 // is not specified since it is synonymous with the one from | 227 // is not specified since it is synonymous with the one from |
| 228 // RenderViewHostImpl, see below. | 228 // RenderViewHostImpl, see below. |
| 229 virtual void SendBeforeUnloadACK(bool proceed) OVERRIDE; | |
| 230 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE; | 229 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE; |
| 231 virtual void SimulateSwapOutACK() OVERRIDE; | |
| 232 virtual void SimulateWasHidden() OVERRIDE; | 230 virtual void SimulateWasHidden() OVERRIDE; |
| 233 virtual void SimulateWasShown() OVERRIDE; | 231 virtual void SimulateWasShown() OVERRIDE; |
| 234 | 232 |
| 235 // NOTE: These methods are deprecated and the equivalents in | 233 // NOTE: These methods are deprecated and the equivalents in |
| 236 // TestRenderFrameHost should be used. | 234 // TestRenderFrameHost should be used. |
| 237 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE; | 235 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE; |
| 238 virtual void SendFailedNavigate(int page_id, const GURL& url) OVERRIDE; | 236 virtual void SendFailedNavigate(int page_id, const GURL& url) OVERRIDE; |
| 239 virtual void SendNavigateWithTransition( | 237 virtual void SendNavigateWithTransition( |
| 240 int page_id, | 238 int page_id, |
| 241 const GURL& url, | 239 const GURL& url, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 264 delete_counter_ = delete_counter; | 262 delete_counter_ = delete_counter; |
| 265 } | 263 } |
| 266 | 264 |
| 267 // Sets whether the RenderView currently exists or not. This controls the | 265 // Sets whether the RenderView currently exists or not. This controls the |
| 268 // return value from IsRenderViewLive, which the rest of the system uses to | 266 // return value from IsRenderViewLive, which the rest of the system uses to |
| 269 // check whether the RenderView has crashed or not. | 267 // check whether the RenderView has crashed or not. |
| 270 void set_render_view_created(bool created) { | 268 void set_render_view_created(bool created) { |
| 271 render_view_created_ = created; | 269 render_view_created_ = created; |
| 272 } | 270 } |
| 273 | 271 |
| 274 // Returns whether the RenderViewHost is currently waiting to hear the result | |
| 275 // of a before unload handler from the renderer. | |
| 276 bool is_waiting_for_beforeunload_ack() const { | |
| 277 return is_waiting_for_beforeunload_ack_; | |
| 278 } | |
| 279 | |
| 280 // Sets whether the RenderViewHost is currently swapped out, and thus | |
| 281 // filtering messages from the renderer. | |
| 282 void set_rvh_state(RenderViewHostImplState rvh_state) { | |
| 283 rvh_state_ = rvh_state; | |
| 284 } | |
| 285 | |
| 286 // If set, navigations will appear to have loaded through a proxy | 272 // If set, navigations will appear to have loaded through a proxy |
| 287 // (ViewHostMsg_FrameNavigte_Params::was_fetched_via_proxy). | 273 // (ViewHostMsg_FrameNavigte_Params::was_fetched_via_proxy). |
| 288 // False by default. | 274 // False by default. |
| 289 void set_simulate_fetch_via_proxy(bool proxy); | 275 void set_simulate_fetch_via_proxy(bool proxy); |
| 290 | 276 |
| 291 // If set, navigations will appear to have cleared the history list in the | 277 // If set, navigations will appear to have cleared the history list in the |
| 292 // RenderView | 278 // RenderView |
| 293 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared). | 279 // (FrameHostMsg_DidCommitProvisionalLoad_Params::history_list_was_cleared). |
| 294 // False by default. | 280 // False by default. |
| 295 void set_simulate_history_list_was_cleared(bool cleared); | 281 void set_simulate_history_list_was_cleared(bool cleared); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 private: | 390 private: |
| 405 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> | 391 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> |
| 406 ScopedSetSupportedScaleFactors; | 392 ScopedSetSupportedScaleFactors; |
| 407 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; | 393 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; |
| 408 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); | 394 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); |
| 409 }; | 395 }; |
| 410 | 396 |
| 411 } // namespace content | 397 } // namespace content |
| 412 | 398 |
| 413 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ | 399 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |