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 <string> | 8 #include <string> |
9 | 9 |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 // Returns a clone of this TestWebContents. The returned object is also a | 70 // Returns a clone of this TestWebContents. The returned object is also a |
71 // TestWebContents. The caller owns the returned object. | 71 // TestWebContents. The caller owns the returned object. |
72 WebContents* Clone() override; | 72 WebContents* Clone() override; |
73 | 73 |
74 // Allow mocking of the RenderViewHostDelegateView. | 74 // Allow mocking of the RenderViewHostDelegateView. |
75 RenderViewHostDelegateView* GetDelegateView() override; | 75 RenderViewHostDelegateView* GetDelegateView() override; |
76 void set_delegate_view(RenderViewHostDelegateView* view) { | 76 void set_delegate_view(RenderViewHostDelegateView* view) { |
77 delegate_view_override_ = view; | 77 delegate_view_override_ = view; |
78 } | 78 } |
79 | 79 |
80 // Allows us to simulate this tab having an opener. | 80 // Allows us to simulate this tab's main frame having an opener that points |
81 // to the main frame of the |opener|. | |
81 void SetOpener(TestWebContents* opener); | 82 void SetOpener(TestWebContents* opener); |
alexmos
2015/06/01 17:44:55
Several unit tests rely on this, so I left this in
Charlie Reis
2015/06/03 20:01:37
Acknowledged.
| |
82 | 83 |
83 // Allows us to simulate that a contents was created via CreateNewWindow. | 84 // Allows us to simulate that a contents was created via CreateNewWindow. |
84 void AddPendingContents(TestWebContents* contents); | 85 void AddPendingContents(TestWebContents* contents); |
85 | 86 |
86 // Establish expected arguments for |SetHistoryOffsetAndLength()|. When | 87 // Establish expected arguments for |SetHistoryOffsetAndLength()|. When |
87 // |SetHistoryOffsetAndLength()| is called, the arguments are compared | 88 // |SetHistoryOffsetAndLength()| is called, the arguments are compared |
88 // with the expected arguments specified here. | 89 // with the expected arguments specified here. |
89 void ExpectSetHistoryOffsetAndLength(int history_offset, | 90 void ExpectSetHistoryOffsetAndLength(int history_offset, |
90 int history_length); | 91 int history_length); |
91 | 92 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 // Expectations for arguments of |SetHistoryOffsetAndLength()|. | 131 // Expectations for arguments of |SetHistoryOffsetAndLength()|. |
131 bool expect_set_history_offset_and_length_; | 132 bool expect_set_history_offset_and_length_; |
132 int expect_set_history_offset_and_length_history_offset_; | 133 int expect_set_history_offset_and_length_history_offset_; |
133 int expect_set_history_offset_and_length_history_length_; | 134 int expect_set_history_offset_and_length_history_length_; |
134 std::string save_frame_headers_; | 135 std::string save_frame_headers_; |
135 }; | 136 }; |
136 | 137 |
137 } // namespace content | 138 } // namespace content |
138 | 139 |
139 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ | 140 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
OLD | NEW |