| 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_WEB_CONTENTS_H_ | 5 #ifndef CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
| 6 #define CONTENT_TEST_TEST_WEB_CONTENTS_H_ | 6 #define CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/public/common/page_transition_types.h" | |
| 10 #include "content/public/common/web_preferences.h" | 9 #include "content/public/common/web_preferences.h" |
| 11 #include "content/public/test/web_contents_tester.h" | 10 #include "content/public/test/web_contents_tester.h" |
| 12 #include "content/test/test_render_frame_host.h" | 11 #include "content/test/test_render_frame_host.h" |
| 13 #include "content/test/test_render_view_host.h" | 12 #include "content/test/test_render_view_host.h" |
| 13 #include "ui/base/page_transition_types.h" |
| 14 | 14 |
| 15 class SiteInstanceImpl; | 15 class SiteInstanceImpl; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 class RenderViewHost; | 19 class RenderViewHost; |
| 20 class TestRenderViewHost; | 20 class TestRenderViewHost; |
| 21 class WebContentsTester; | 21 class WebContentsTester; |
| 22 | 22 |
| 23 // Subclass WebContentsImpl to ensure it creates TestRenderViewHosts | 23 // Subclass WebContentsImpl to ensure it creates TestRenderViewHosts |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // WebContentsTester implementation. | 36 // WebContentsTester implementation. |
| 37 virtual void CommitPendingNavigation() OVERRIDE; | 37 virtual void CommitPendingNavigation() OVERRIDE; |
| 38 virtual TestRenderFrameHost* GetPendingMainFrame() const OVERRIDE; | 38 virtual TestRenderFrameHost* GetPendingMainFrame() const OVERRIDE; |
| 39 virtual void NavigateAndCommit(const GURL& url) OVERRIDE; | 39 virtual void NavigateAndCommit(const GURL& url) OVERRIDE; |
| 40 virtual void TestSetIsLoading(bool value) OVERRIDE; | 40 virtual void TestSetIsLoading(bool value) OVERRIDE; |
| 41 virtual void ProceedWithCrossSiteNavigation() OVERRIDE; | 41 virtual void ProceedWithCrossSiteNavigation() OVERRIDE; |
| 42 virtual void TestDidNavigate(RenderFrameHost* render_frame_host, | 42 virtual void TestDidNavigate(RenderFrameHost* render_frame_host, |
| 43 int page_id, | 43 int page_id, |
| 44 const GURL& url, | 44 const GURL& url, |
| 45 PageTransition transition) OVERRIDE; | 45 ui::PageTransition transition) OVERRIDE; |
| 46 virtual void TestDidNavigateWithReferrer(RenderFrameHost* render_frame_host, | 46 virtual void TestDidNavigateWithReferrer( |
| 47 int page_id, | 47 RenderFrameHost* render_frame_host, |
| 48 const GURL& url, | 48 int page_id, |
| 49 const Referrer& referrer, | 49 const GURL& url, |
| 50 PageTransition transition) OVERRIDE; | 50 const Referrer& referrer, |
| 51 ui::PageTransition transition) OVERRIDE; |
| 51 virtual WebPreferences TestComputeWebkitPrefs() OVERRIDE; | 52 virtual WebPreferences TestComputeWebkitPrefs() OVERRIDE; |
| 52 | 53 |
| 53 // State accessor. | 54 // State accessor. |
| 54 bool cross_navigation_pending() { | 55 bool cross_navigation_pending() { |
| 55 return GetRenderManager()->cross_navigation_pending_; | 56 return GetRenderManager()->cross_navigation_pending_; |
| 56 } | 57 } |
| 57 | 58 |
| 58 // Prevent interaction with views. | 59 // Prevent interaction with views. |
| 59 virtual bool CreateRenderViewForRenderManager( | 60 virtual bool CreateRenderViewForRenderManager( |
| 60 RenderViewHost* render_view_host, | 61 RenderViewHost* render_view_host, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 bool expect_set_history_length_and_prune_; | 130 bool expect_set_history_length_and_prune_; |
| 130 scoped_refptr<const SiteInstanceImpl> | 131 scoped_refptr<const SiteInstanceImpl> |
| 131 expect_set_history_length_and_prune_site_instance_; | 132 expect_set_history_length_and_prune_site_instance_; |
| 132 int expect_set_history_length_and_prune_history_length_; | 133 int expect_set_history_length_and_prune_history_length_; |
| 133 int32 expect_set_history_length_and_prune_min_page_id_; | 134 int32 expect_set_history_length_and_prune_min_page_id_; |
| 134 }; | 135 }; |
| 135 | 136 |
| 136 } // namespace content | 137 } // namespace content |
| 137 | 138 |
| 138 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ | 139 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
| OLD | NEW |