Chromium Code Reviews| 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_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
| 6 #define CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/browser/tab_contents/tab_contents.h" | 9 #include "content/browser/tab_contents/tab_contents.h" |
| 10 #include "webkit/glue/webpreferences.h" | 10 #include "webkit/glue/webpreferences.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 DidNavigate(render_view_host, params); | 35 DidNavigate(render_view_host, params); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Promote GetWebkitPrefs to public. | 38 // Promote GetWebkitPrefs to public. |
| 39 WebPreferences TestGetWebkitPrefs() { | 39 WebPreferences TestGetWebkitPrefs() { |
| 40 return GetWebkitPrefs(); | 40 return GetWebkitPrefs(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Prevent interaction with views. | 43 // Prevent interaction with views. |
| 44 virtual bool CreateRenderViewForRenderManager( | 44 virtual bool CreateRenderViewForRenderManager( |
| 45 RenderViewHost* render_view_host); | 45 RenderViewHost* render_view_host) OVERRIDE; |
| 46 virtual void UpdateRenderViewSizeForRenderManager() {} | 46 virtual void UpdateRenderViewSizeForRenderManager() OVERRIDE {} |
| 47 | 47 |
| 48 // Returns a clone of this TestTabContents. The returned object is also a | 48 // Returns a clone of this TestTabContents. The returned object is also a |
| 49 // TestTabContents. The caller owns the returned object. | 49 // TestTabContents. The caller owns the returned object. |
| 50 virtual TabContents* Clone(); | 50 virtual TabContents* Clone() OVERRIDE; |
| 51 | 51 |
| 52 // Creates a pending navigation to the given URL with the default parameters | 52 // Creates a pending navigation to the given URL with the default parameters |
| 53 // and then commits the load with a page ID one larger than any seen. This | 53 // and then commits the load with a page ID one larger than any seen. This |
| 54 // emulates what happens on a new navigation. | 54 // emulates what happens on a new navigation. |
| 55 void NavigateAndCommit(const GURL& url); | 55 void NavigateAndCommit(const GURL& url); |
| 56 | 56 |
| 57 // Simulates the appropriate RenderView (pending if any, current otherwise) | 57 // Simulates the appropriate RenderView (pending if any, current otherwise) |
| 58 // sending a navigate notification for the NavigationController pending entry. | 58 // sending a navigate notification for the NavigationController pending entry. |
| 59 void CommitPendingNavigation(); | 59 void CommitPendingNavigation(); |
| 60 | 60 |
| 61 // Simulates the current RVH notifying that it has unloaded so that the | 61 // Simulates the current RVH notifying that it has unloaded so that the |
| 62 // pending RVH navigation can proceed. | 62 // pending RVH navigation can proceed. |
| 63 // Does nothing if no cross-navigation is pending. | 63 // Does nothing if no cross-navigation is pending. |
| 64 void ProceedWithCrossSiteNavigation(); | 64 void ProceedWithCrossSiteNavigation(); |
| 65 | 65 |
| 66 // Set by individual tests. | 66 // Set by individual tests. |
| 67 bool transition_cross_site; | 67 bool transition_cross_site; |
| 68 | 68 |
| 69 // Allow mocking of the RenderViewHostDelegate::View. | 69 // Allow mocking of the RenderViewHostDelegate::View. |
| 70 virtual RenderViewHostDelegate::View* GetViewDelegate(); | 70 virtual RenderViewHostDelegate::View* GetViewDelegate() OVERRIDE; |
| 71 void set_view_delegate(RenderViewHostDelegate::View* view) { | 71 void set_view_delegate(RenderViewHostDelegate::View* view) { |
| 72 delegate_view_override_ = view; | 72 delegate_view_override_ = view; |
| 73 } | 73 } |
| 74 | |
| 75 void ExpectSetHistoryLengthAndPrune(const SiteInstance* site_instance, | |
|
cbentzel
2011/08/13 00:09:28
I'll need a comment for this function.
cbentzel
2011/08/13 02:19:12
Done.
| |
| 76 int history_length, | |
| 77 int32 min_page_id); | |
| 78 virtual void SetHistoryLengthAndPrune(const SiteInstance* site_instance, | |
|
cbentzel
2011/08/13 00:09:28
Perhaps here as well.
cbentzel
2011/08/13 02:19:12
Done.
| |
| 79 int history_length, | |
| 80 int32 min_page_id) OVERRIDE; | |
| 81 | |
| 74 private: | 82 private: |
| 75 RenderViewHostDelegate::View* delegate_view_override_; | 83 RenderViewHostDelegate::View* delegate_view_override_; |
| 84 | |
| 85 // Expectations for call to SetHistoryLengthAndPrune | |
| 86 bool expect_set_history_length_and_prune_; | |
| 87 const SiteInstance* expect_set_history_length_and_prune_site_instance_; | |
| 88 int expect_set_history_length_and_prune_history_length_; | |
| 89 int32 expect_set_history_length_and_prune_min_page_id_; | |
| 76 }; | 90 }; |
| 77 | 91 |
| 78 #endif // CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ | 92 #endif // CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
| OLD | NEW |