| 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" | 9 #include "content/public/common/page_transition_types.h" |
| 10 #include "content/public/test/web_contents_tester.h" | 10 #include "content/public/test/web_contents_tester.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Allow mocking of the RenderViewHostDelegateView. | 70 // Allow mocking of the RenderViewHostDelegateView. |
| 71 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; | 71 virtual RenderViewHostDelegateView* GetDelegateView() OVERRIDE; |
| 72 void set_delegate_view(RenderViewHostDelegateView* view) { | 72 void set_delegate_view(RenderViewHostDelegateView* view) { |
| 73 delegate_view_override_ = view; | 73 delegate_view_override_ = view; |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Allows us to simulate this tab having an opener. | 76 // Allows us to simulate this tab having an opener. |
| 77 void SetOpener(TestWebContents* opener); | 77 void SetOpener(TestWebContents* opener); |
| 78 | 78 |
| 79 // Allows us to simulate that a contents was created via CreateNewWindow. |
| 80 void AddPendingContents(TestWebContents* contents); |
| 81 |
| 79 // Establish expected arguments for |SetHistoryLengthAndPrune()|. When | 82 // Establish expected arguments for |SetHistoryLengthAndPrune()|. When |
| 80 // |SetHistoryLengthAndPrune()| is called, the arguments are compared | 83 // |SetHistoryLengthAndPrune()| is called, the arguments are compared |
| 81 // with the expected arguments specified here. | 84 // with the expected arguments specified here. |
| 82 void ExpectSetHistoryLengthAndPrune(const SiteInstance* site_instance, | 85 void ExpectSetHistoryLengthAndPrune(const SiteInstance* site_instance, |
| 83 int history_length, | 86 int history_length, |
| 84 int32 min_page_id); | 87 int32 min_page_id); |
| 85 | 88 |
| 86 // Compares the arguments passed in with the expected arguments passed in | 89 // Compares the arguments passed in with the expected arguments passed in |
| 87 // to |ExpectSetHistoryLengthAndPrune()|. | 90 // to |ExpectSetHistoryLengthAndPrune()|. |
| 88 virtual void SetHistoryLengthAndPrune(const SiteInstance* site_instance, | 91 virtual void SetHistoryLengthAndPrune(const SiteInstance* site_instance, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 bool expect_set_history_length_and_prune_; | 127 bool expect_set_history_length_and_prune_; |
| 125 scoped_refptr<const SiteInstanceImpl> | 128 scoped_refptr<const SiteInstanceImpl> |
| 126 expect_set_history_length_and_prune_site_instance_; | 129 expect_set_history_length_and_prune_site_instance_; |
| 127 int expect_set_history_length_and_prune_history_length_; | 130 int expect_set_history_length_and_prune_history_length_; |
| 128 int32 expect_set_history_length_and_prune_min_page_id_; | 131 int32 expect_set_history_length_and_prune_min_page_id_; |
| 129 }; | 132 }; |
| 130 | 133 |
| 131 } // namespace content | 134 } // namespace content |
| 132 | 135 |
| 133 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ | 136 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
| OLD | NEW |