| 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_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 "content/public/common/page_transition_types.h" | 10 #include "content/public/common/page_transition_types.h" |
| 11 #include "webkit/glue/webpreferences.h" | 11 #include "webkit/glue/webpreferences.h" |
| 12 | 12 |
| 13 class SiteInstanceImpl; | 13 class SiteInstanceImpl; |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class RenderViewHost; |
| 16 class TestRenderViewHost; | 17 class TestRenderViewHost; |
| 17 } | 18 } |
| 18 | 19 |
| 19 // Subclass TabContents to ensure it creates TestRenderViewHosts and does | 20 // Subclass TabContents to ensure it creates TestRenderViewHosts |
| 20 // not do anything involving views. | 21 // and does not do anything involving views. |
| 21 class TestTabContents : public TabContents { | 22 class TestTabContents : public TabContents { |
| 22 public: | 23 public: |
| 23 TestTabContents(content::BrowserContext* browser_context, | 24 TestTabContents(content::BrowserContext* browser_context, |
| 24 content::SiteInstance* instance); | 25 content::SiteInstance* instance); |
| 25 virtual ~TestTabContents(); | 26 virtual ~TestTabContents(); |
| 26 | 27 |
| 27 content::TestRenderViewHost* pending_rvh() const; | 28 content::RenderViewHost* pending_rvh() const; |
| 29 |
| 30 // TODO(joi): Make sure this one is hidden once TestTabContents |
| 31 // hides internal types from embedders. |
| 32 content::TestRenderViewHost* pending_test_rvh() const; |
| 28 | 33 |
| 29 // State accessor. | 34 // State accessor. |
| 30 bool cross_navigation_pending() { | 35 bool cross_navigation_pending() { |
| 31 return render_manager_.cross_navigation_pending_; | 36 return render_manager_.cross_navigation_pending_; |
| 32 } | 37 } |
| 33 | 38 |
| 34 // Overrides TabContents::ShouldTransitionCrossSite so that we can test both | 39 // Overrides TabContents::ShouldTransitionCrossSite so that we can test both |
| 35 // alternatives without using command-line switches. | 40 // alternatives without using command-line switches. |
| 36 bool ShouldTransitionCrossSite() { return transition_cross_site; } | 41 bool ShouldTransitionCrossSite() { return transition_cross_site; } |
| 37 | 42 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 107 |
| 103 // Expectations for arguments of |SetHistoryLengthAndPrune()|. | 108 // Expectations for arguments of |SetHistoryLengthAndPrune()|. |
| 104 bool expect_set_history_length_and_prune_; | 109 bool expect_set_history_length_and_prune_; |
| 105 scoped_refptr<const SiteInstanceImpl> | 110 scoped_refptr<const SiteInstanceImpl> |
| 106 expect_set_history_length_and_prune_site_instance_; | 111 expect_set_history_length_and_prune_site_instance_; |
| 107 int expect_set_history_length_and_prune_history_length_; | 112 int expect_set_history_length_and_prune_history_length_; |
| 108 int32 expect_set_history_length_and_prune_min_page_id_; | 113 int32 expect_set_history_length_and_prune_min_page_id_; |
| 109 }; | 114 }; |
| 110 | 115 |
| 111 #endif // CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ | 116 #endif // CONTENT_BROWSER_TAB_CONTENTS_TEST_TAB_CONTENTS_H_ |
| OLD | NEW |