| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "content/browser/web_contents/web_contents_impl.h" | 12 #include "content/browser/web_contents/web_contents_impl.h" |
| 13 #include "content/public/test/web_contents_tester.h" | 13 #include "content/public/test/web_contents_tester.h" |
| 14 #include "content/test/test_render_frame_host.h" | 14 #include "content/test/test_render_frame_host.h" |
| 15 #include "content/test/test_render_view_host.h" | 15 #include "content/test/test_render_view_host.h" |
| 16 #include "ui/base/page_transition_types.h" | 16 #include "ui/base/page_transition_types.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 class Referrer; | 19 class Referrer; |
| 20 class SiteInstanceImpl; | 20 class SiteInstanceImpl; |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 class NavigationData; |
| 25 class NavigationHandle; |
| 24 class RenderViewHost; | 26 class RenderViewHost; |
| 25 class TestRenderViewHost; | 27 class TestRenderViewHost; |
| 26 class WebContentsTester; | 28 class WebContentsTester; |
| 27 | 29 |
| 28 // Subclass WebContentsImpl to ensure it creates TestRenderViewHosts | 30 // Subclass WebContentsImpl to ensure it creates TestRenderViewHosts |
| 29 // and does not do anything involving views. | 31 // and does not do anything involving views. |
| 30 class TestWebContents : public WebContentsImpl, public WebContentsTester { | 32 class TestWebContents : public WebContentsImpl, public WebContentsTester { |
| 31 public: | 33 public: |
| 32 ~TestWebContents() override; | 34 ~TestWebContents() override; |
| 33 | 35 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // to |ExpectSetHistoryOffsetAndLength()|. | 106 // to |ExpectSetHistoryOffsetAndLength()|. |
| 105 void SetHistoryOffsetAndLength(int history_offset, | 107 void SetHistoryOffsetAndLength(int history_offset, |
| 106 int history_length) override; | 108 int history_length) override; |
| 107 | 109 |
| 108 void TestDidFinishLoad(const GURL& url); | 110 void TestDidFinishLoad(const GURL& url); |
| 109 void TestDidFailLoadWithError(const GURL& url, | 111 void TestDidFailLoadWithError(const GURL& url, |
| 110 int error_code, | 112 int error_code, |
| 111 const base::string16& error_description, | 113 const base::string16& error_description, |
| 112 bool was_ignored_by_handler); | 114 bool was_ignored_by_handler); |
| 113 | 115 |
| 116 void SetNavigationData( |
| 117 NavigationHandle* navigation_handle, |
| 118 std::unique_ptr<NavigationData> navigation_data) override; |
| 119 |
| 114 protected: | 120 protected: |
| 115 // The deprecated WebContentsTester still needs to subclass this. | 121 // The deprecated WebContentsTester still needs to subclass this. |
| 116 explicit TestWebContents(BrowserContext* browser_context); | 122 explicit TestWebContents(BrowserContext* browser_context); |
| 117 | 123 |
| 118 private: | 124 private: |
| 119 // WebContentsImpl overrides | 125 // WebContentsImpl overrides |
| 120 void CreateNewWindow( | 126 void CreateNewWindow( |
| 121 SiteInstance* source_site_instance, | 127 SiteInstance* source_site_instance, |
| 122 int32_t route_id, | 128 int32_t route_id, |
| 123 int32_t main_frame_route_id, | 129 int32_t main_frame_route_id, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 144 // Expectations for arguments of |SetHistoryOffsetAndLength()|. | 150 // Expectations for arguments of |SetHistoryOffsetAndLength()|. |
| 145 bool expect_set_history_offset_and_length_; | 151 bool expect_set_history_offset_and_length_; |
| 146 int expect_set_history_offset_and_length_history_offset_; | 152 int expect_set_history_offset_and_length_history_offset_; |
| 147 int expect_set_history_offset_and_length_history_length_; | 153 int expect_set_history_offset_and_length_history_length_; |
| 148 std::string save_frame_headers_; | 154 std::string save_frame_headers_; |
| 149 }; | 155 }; |
| 150 | 156 |
| 151 } // namespace content | 157 } // namespace content |
| 152 | 158 |
| 153 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ | 159 #endif // CONTENT_TEST_TEST_WEB_CONTENTS_H_ |
| OLD | NEW |