OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class TestTabContents; | 31 class TestTabContents; |
32 struct ViewHostMsg_FrameNavigate_Params; | 32 struct ViewHostMsg_FrameNavigate_Params; |
33 | 33 |
34 // Utility function to initialize ViewHostMsg_NavigateParams_Params | 34 // Utility function to initialize ViewHostMsg_NavigateParams_Params |
35 // with given |page_id|, |url| and |transition_type|. | 35 // with given |page_id|, |url| and |transition_type|. |
36 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, | 36 void InitNavigateParams(ViewHostMsg_FrameNavigate_Params* params, |
37 int page_id, | 37 int page_id, |
38 const GURL& url, | 38 const GURL& url, |
39 content::PageTransition transition_type); | 39 content::PageTransition transition_type); |
40 | 40 |
| 41 // Utility function to fake the ViewHostMsg_UpdateRect IPC arriving at a RWH. |
| 42 void SimulateUpdateRect(RenderWidgetHost* widget, |
| 43 TransportDIB::Id bitmap, |
| 44 const gfx::Rect& rect); |
| 45 |
41 // This file provides a testing framework for mocking out the RenderProcessHost | 46 // This file provides a testing framework for mocking out the RenderProcessHost |
42 // layer. It allows you to test RenderViewHost, TabContents, | 47 // layer. It allows you to test RenderViewHost, TabContents, |
43 // NavigationController, and other layers above that without running an actual | 48 // NavigationController, and other layers above that without running an actual |
44 // renderer process. | 49 // renderer process. |
45 // | 50 // |
46 // To use, derive your test base class from RenderViewHostTestHarness. | 51 // To use, derive your test base class from RenderViewHostTestHarness. |
47 | 52 |
48 // TestRenderViewHostView ------------------------------------------------------ | 53 // TestRenderViewHostView ------------------------------------------------------ |
49 | 54 |
50 // Subclass the RenderViewHost's view so that we can call Show(), etc., | 55 // Subclass the RenderViewHost's view so that we can call Show(), etc., |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 MockRenderProcessHostFactory rph_factory_; | 335 MockRenderProcessHostFactory rph_factory_; |
331 TestRenderViewHostFactory rvh_factory_; | 336 TestRenderViewHostFactory rvh_factory_; |
332 | 337 |
333 private: | 338 private: |
334 scoped_ptr<TestTabContents> contents_; | 339 scoped_ptr<TestTabContents> contents_; |
335 | 340 |
336 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); | 341 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); |
337 }; | 342 }; |
338 | 343 |
339 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 344 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
OLD | NEW |