Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Side by Side Diff: content/test/test_render_view_host.h

Issue 562603002: Move PageTransition from //content/public/common to //ui/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/test/test_render_frame_host.cc ('k') | content/test/test_render_view_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "content/browser/renderer_host/render_view_host_impl.h" 14 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/browser/renderer_host/render_widget_host_view_base.h" 15 #include "content/browser/renderer_host/render_widget_host_view_base.h"
16 #include "content/public/common/page_transition_types.h"
17 #include "content/public/test/test_renderer_host.h" 16 #include "content/public/test/test_renderer_host.h"
18 #include "ui/base/ime/dummy_text_input_client.h" 17 #include "ui/base/ime/dummy_text_input_client.h"
19 #include "ui/base/layout.h" 18 #include "ui/base/layout.h"
19 #include "ui/base/page_transition_types.h"
20 #include "ui/gfx/vector2d_f.h" 20 #include "ui/gfx/vector2d_f.h"
21 21
22 // This file provides a testing framework for mocking out the RenderProcessHost 22 // This file provides a testing framework for mocking out the RenderProcessHost
23 // layer. It allows you to test RenderViewHost, WebContentsImpl, 23 // layer. It allows you to test RenderViewHost, WebContentsImpl,
24 // NavigationController, and other layers above that without running an actual 24 // NavigationController, and other layers above that without running an actual
25 // renderer process. 25 // renderer process.
26 // 26 //
27 // To use, derive your test base class from RenderViewHostImplTestHarness. 27 // To use, derive your test base class from RenderViewHostImplTestHarness.
28 28
29 struct FrameHostMsg_DidCommitProvisionalLoad_Params; 29 struct FrameHostMsg_DidCommitProvisionalLoad_Params;
30 struct ViewHostMsg_TextInputState_Params; 30 struct ViewHostMsg_TextInputState_Params;
31 31
32 namespace gfx { 32 namespace gfx {
33 class Rect; 33 class Rect;
34 } 34 }
35 35
36 namespace content { 36 namespace content {
37 37
38 class SiteInstance; 38 class SiteInstance;
39 class TestRenderFrameHost; 39 class TestRenderFrameHost;
40 class TestWebContents; 40 class TestWebContents;
41 41
42 // Utility function to initialize ViewHostMsg_NavigateParams_Params 42 // Utility function to initialize ViewHostMsg_NavigateParams_Params
43 // with given |page_id|, |url| and |transition_type|. 43 // with given |page_id|, |url| and |transition_type|.
44 void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params, 44 void InitNavigateParams(FrameHostMsg_DidCommitProvisionalLoad_Params* params,
45 int page_id, 45 int page_id,
46 const GURL& url, 46 const GURL& url,
47 PageTransition transition_type); 47 ui::PageTransition transition_type);
48 48
49 // TestRenderViewHostView ------------------------------------------------------ 49 // TestRenderViewHostView ------------------------------------------------------
50 50
51 // Subclass the RenderViewHost's view so that we can call Show(), etc., 51 // Subclass the RenderViewHost's view so that we can call Show(), etc.,
52 // without having side-effects. 52 // without having side-effects.
53 class TestRenderWidgetHostView : public RenderWidgetHostViewBase { 53 class TestRenderWidgetHostView : public RenderWidgetHostViewBase {
54 public: 54 public:
55 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh); 55 explicit TestRenderWidgetHostView(RenderWidgetHost* rwh);
56 virtual ~TestRenderWidgetHostView(); 56 virtual ~TestRenderWidgetHostView();
57 57
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 virtual void SendBeforeUnloadACK(bool proceed) OVERRIDE; 226 virtual void SendBeforeUnloadACK(bool proceed) OVERRIDE;
227 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE; 227 virtual void SetContentsMimeType(const std::string& mime_type) OVERRIDE;
228 virtual void SimulateSwapOutACK() OVERRIDE; 228 virtual void SimulateSwapOutACK() OVERRIDE;
229 virtual void SimulateWasHidden() OVERRIDE; 229 virtual void SimulateWasHidden() OVERRIDE;
230 virtual void SimulateWasShown() OVERRIDE; 230 virtual void SimulateWasShown() OVERRIDE;
231 231
232 // NOTE: These methods are deprecated and the equivalents in 232 // NOTE: These methods are deprecated and the equivalents in
233 // TestRenderFrameHost should be used. 233 // TestRenderFrameHost should be used.
234 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE; 234 virtual void SendNavigate(int page_id, const GURL& url) OVERRIDE;
235 virtual void SendFailedNavigate(int page_id, const GURL& url) OVERRIDE; 235 virtual void SendFailedNavigate(int page_id, const GURL& url) OVERRIDE;
236 virtual void SendNavigateWithTransition(int page_id, const GURL& url, 236 virtual void SendNavigateWithTransition(
237 PageTransition transition) OVERRIDE; 237 int page_id,
238 const GURL& url,
239 ui::PageTransition transition) OVERRIDE;
238 240
239 // Calls OnNavigate on the RenderViewHost with the given information, 241 // Calls OnNavigate on the RenderViewHost with the given information,
240 // including a custom original request URL. Sets the rest of the 242 // including a custom original request URL. Sets the rest of the
241 // parameters in the message to the "typical" values. This is a helper 243 // parameters in the message to the "typical" values. This is a helper
242 // function for simulating the most common types of loads. 244 // function for simulating the most common types of loads.
243 void SendNavigateWithOriginalRequestURL( 245 void SendNavigateWithOriginalRequestURL(
244 int page_id, const GURL& url, const GURL& original_request_url); 246 int page_id, const GURL& url, const GURL& original_request_url);
245 247
246 void SendNavigateWithFile( 248 void SendNavigateWithFile(
247 int page_id, const GURL& url, const base::FilePath& file_path); 249 int page_id, const GURL& url, const base::FilePath& file_path);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 int32 max_page_id, 310 int32 max_page_id,
309 bool window_was_created_with_opener) OVERRIDE; 311 bool window_was_created_with_opener) OVERRIDE;
310 virtual bool IsRenderViewLive() const OVERRIDE; 312 virtual bool IsRenderViewLive() const OVERRIDE;
311 virtual bool IsFullscreen() const OVERRIDE; 313 virtual bool IsFullscreen() const OVERRIDE;
312 314
313 private: 315 private:
314 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate); 316 FRIEND_TEST_ALL_PREFIXES(RenderViewHostTest, FilterNavigate);
315 317
316 void SendNavigateWithTransitionAndResponseCode(int page_id, 318 void SendNavigateWithTransitionAndResponseCode(int page_id,
317 const GURL& url, 319 const GURL& url,
318 PageTransition transition, 320 ui::PageTransition transition,
319 int response_code); 321 int response_code);
320 322
321 // Calls OnNavigate on the RenderViewHost with the given information. 323 // Calls OnNavigate on the RenderViewHost with the given information.
322 // Sets the rest of the parameters in the message to the "typical" values. 324 // Sets the rest of the parameters in the message to the "typical" values.
323 // This is a helper function for simulating the most common types of loads. 325 // This is a helper function for simulating the most common types of loads.
324 void SendNavigateWithParameters( 326 void SendNavigateWithParameters(
325 int page_id, 327 int page_id,
326 const GURL& url, 328 const GURL& url,
327 PageTransition transition, 329 ui::PageTransition transition,
328 const GURL& original_request_url, 330 const GURL& original_request_url,
329 int response_code, 331 int response_code,
330 const base::FilePath* file_path_for_history_item); 332 const base::FilePath* file_path_for_history_item);
331 333
332 // Tracks if the caller thinks if it created the RenderView. This is so we can 334 // Tracks if the caller thinks if it created the RenderView. This is so we can
333 // respond to IsRenderViewLive appropriately. 335 // respond to IsRenderViewLive appropriately.
334 bool render_view_created_; 336 bool render_view_created_;
335 337
336 // See set_delete_counter() above. May be NULL. 338 // See set_delete_counter() above. May be NULL.
337 int* delete_counter_; 339 int* delete_counter_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 private: 401 private:
400 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> 402 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors>
401 ScopedSetSupportedScaleFactors; 403 ScopedSetSupportedScaleFactors;
402 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; 404 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_;
403 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); 405 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness);
404 }; 406 };
405 407
406 } // namespace content 408 } // namespace content
407 409
408 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 410 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
OLDNEW
« no previous file with comments | « content/test/test_render_frame_host.cc ('k') | content/test/test_render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698