| 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/web_preferences.h" | 9 #include "content/public/common/web_preferences.h" |
| 10 #include "content/public/test/web_contents_tester.h" | 10 #include "content/public/test/web_contents_tester.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void set_delegate_view(RenderViewHostDelegateView* view) { | 71 void set_delegate_view(RenderViewHostDelegateView* view) { |
| 72 delegate_view_override_ = view; | 72 delegate_view_override_ = view; |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Allows us to simulate this tab having an opener. | 75 // Allows us to simulate this tab having an opener. |
| 76 void SetOpener(TestWebContents* opener); | 76 void SetOpener(TestWebContents* opener); |
| 77 | 77 |
| 78 // Allows us to simulate that a contents was created via CreateNewWindow. | 78 // Allows us to simulate that a contents was created via CreateNewWindow. |
| 79 void AddPendingContents(TestWebContents* contents); | 79 void AddPendingContents(TestWebContents* contents); |
| 80 | 80 |
| 81 // Establish expected arguments for |SetHistoryLengthAndPrune()|. When | 81 // Establish expected arguments for |SetHistoryOffsetAndLength()|. When |
| 82 // |SetHistoryLengthAndPrune()| is called, the arguments are compared | 82 // |SetHistoryOffsetAndLength()| is called, the arguments are compared |
| 83 // with the expected arguments specified here. | 83 // with the expected arguments specified here. |
| 84 void ExpectSetHistoryLengthAndPrune(const SiteInstance* site_instance, | 84 void ExpectSetHistoryOffsetAndLength(int history_offset, |
| 85 int history_length, | 85 int history_length); |
| 86 int32 min_page_id); | |
| 87 | 86 |
| 88 // Compares the arguments passed in with the expected arguments passed in | 87 // Compares the arguments passed in with the expected arguments passed in |
| 89 // to |ExpectSetHistoryLengthAndPrune()|. | 88 // to |ExpectSetHistoryOffsetAndLength()|. |
| 90 void SetHistoryLengthAndPrune(const SiteInstance* site_instance, | 89 void SetHistoryOffsetAndLength(int history_offset, |
| 91 int history_length, | 90 int history_length) override; |
| 92 int32 min_page_id) override; | |
| 93 | 91 |
| 94 void TestDidFinishLoad(const GURL& url); | 92 void TestDidFinishLoad(const GURL& url); |
| 95 void TestDidFailLoadWithError(const GURL& url, | 93 void TestDidFailLoadWithError(const GURL& url, |
| 96 int error_code, | 94 int error_code, |
| 97 const base::string16& error_description); | 95 const base::string16& error_description); |
| 98 | 96 |
| 99 protected: | 97 protected: |
| 100 // The deprecated WebContentsTester still needs to subclass this. | 98 // The deprecated WebContentsTester still needs to subclass this. |
| 101 explicit TestWebContents(BrowserContext* browser_context); | 99 explicit TestWebContents(BrowserContext* browser_context); |
| 102 | 100 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 114 void CreateNewFullscreenWidget(int render_process_id, int route_id) override; | 112 void CreateNewFullscreenWidget(int render_process_id, int route_id) override; |
| 115 void ShowCreatedWindow(int route_id, | 113 void ShowCreatedWindow(int route_id, |
| 116 WindowOpenDisposition disposition, | 114 WindowOpenDisposition disposition, |
| 117 const gfx::Rect& initial_pos, | 115 const gfx::Rect& initial_pos, |
| 118 bool user_gesture) override; | 116 bool user_gesture) override; |
| 119 void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override; | 117 void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override; |
| 120 void ShowCreatedFullscreenWidget(int route_id) override; | 118 void ShowCreatedFullscreenWidget(int route_id) override; |
| 121 | 119 |
| 122 RenderViewHostDelegateView* delegate_view_override_; | 120 RenderViewHostDelegateView* delegate_view_override_; |
| 123 | 121 |
| 124 // Expectations for arguments of |SetHistoryLengthAndPrune()|. | 122 // Expectations for arguments of |SetHistoryOffsetAndLength()|. |
| 125 bool expect_set_history_length_and_prune_; | 123 bool expect_set_history_offset_and_length_; |
| 126 scoped_refptr<const SiteInstanceImpl> | 124 int expect_set_history_offset_and_length_history_offset_; |
| 127 expect_set_history_length_and_prune_site_instance_; | 125 int expect_set_history_offset_and_length_history_length_; |
| 128 int expect_set_history_length_and_prune_history_length_; | |
| 129 int32 expect_set_history_length_and_prune_min_page_id_; | |
| 130 }; | 126 }; |
| 131 | 127 |
| 132 } // namespace content | 128 } // namespace content |
| 133 | 129 |
| 134 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ | 130 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
| OLD | NEW |