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_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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 // The reason we do it this way instead of using composition is | 213 // The reason we do it this way instead of using composition is |
214 // similar to (b) above, essentially it gets very tricky. By using | 214 // similar to (b) above, essentially it gets very tricky. By using |
215 // the split interface we avoid complexity within content and maintain | 215 // the split interface we avoid complexity within content and maintain |
216 // reasonable utility for embedders. | 216 // reasonable utility for embedders. |
217 class TestRenderViewHost | 217 class TestRenderViewHost |
218 : public RenderViewHostImpl, | 218 : public RenderViewHostImpl, |
219 public RenderViewHostTester { | 219 public RenderViewHostTester { |
220 public: | 220 public: |
221 TestRenderViewHost(SiteInstance* instance, | 221 TestRenderViewHost(SiteInstance* instance, |
222 RenderViewHostDelegate* delegate, | 222 RenderViewHostDelegate* delegate, |
223 int routing_id); | 223 int routing_id, |
| 224 bool swapped_out); |
224 virtual ~TestRenderViewHost(); | 225 virtual ~TestRenderViewHost(); |
225 | 226 |
226 // RenderViewHostTester implementation. Note that CreateRenderView | 227 // RenderViewHostTester implementation. Note that CreateRenderView |
227 // is not specified since it is synonymous with the one from | 228 // is not specified since it is synonymous with the one from |
228 // RenderViewHostImpl, see below. | 229 // RenderViewHostImpl, see below. |
229 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE; | 230 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE; |
230 virtual void SendNavigateWithTransition(int page_id, const GURL& url, | 231 virtual void SendNavigateWithTransition(int page_id, const GURL& url, |
231 PageTransition transition) OVERRIDE; | 232 PageTransition transition) OVERRIDE; |
232 virtual void SendShouldCloseACK(bool proceed) OVERRIDE; | 233 virtual void SendShouldCloseACK(bool proceed) OVERRIDE; |
233 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE; | 234 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 269 } |
269 | 270 |
270 // If set, navigations will appear to have loaded through a proxy | 271 // If set, navigations will appear to have loaded through a proxy |
271 // (ViewHostMsg_FrameNavigte_Params::was_fetched_via_proxy). | 272 // (ViewHostMsg_FrameNavigte_Params::was_fetched_via_proxy). |
272 // False by default. | 273 // False by default. |
273 void set_simulate_fetch_via_proxy(bool proxy); | 274 void set_simulate_fetch_via_proxy(bool proxy); |
274 | 275 |
275 // RenderViewHost overrides -------------------------------------------------- | 276 // RenderViewHost overrides -------------------------------------------------- |
276 | 277 |
277 virtual bool CreateRenderView(const string16& frame_name, | 278 virtual bool CreateRenderView(const string16& frame_name, |
| 279 int opener_route_id, |
278 int32 max_page_id) OVERRIDE; | 280 int32 max_page_id) OVERRIDE; |
279 virtual bool IsRenderViewLive() const OVERRIDE; | 281 virtual bool IsRenderViewLive() const OVERRIDE; |
280 | 282 |
281 private: | 283 private: |
282 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); | 284 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); |
283 | 285 |
284 // Tracks if the caller thinks if it created the RenderView. This is so we can | 286 // Tracks if the caller thinks if it created the RenderView. This is so we can |
285 // respond to IsRenderViewLive appropriately. | 287 // respond to IsRenderViewLive appropriately. |
286 bool render_view_created_; | 288 bool render_view_created_; |
287 | 289 |
(...skipping 25 matching lines...) Expand all Loading... |
313 TestRenderViewHost* active_test_rvh(); | 315 TestRenderViewHost* active_test_rvh(); |
314 TestWebContents* contents(); | 316 TestWebContents* contents(); |
315 | 317 |
316 private: | 318 private: |
317 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); | 319 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); |
318 }; | 320 }; |
319 | 321 |
320 } // namespace content | 322 } // namespace content |
321 | 323 |
322 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ | 324 #endif // CONTENT_BROWSER_RENDERER_HOST_TEST_RENDER_VIEW_HOST_H_ |
OLD | NEW |