| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 bool canCreatePluginWithoutRenderer( | 83 bool canCreatePluginWithoutRenderer( |
| 84 const blink::WebString& mime_type) override { | 84 const blink::WebString& mime_type) override { |
| 85 const char suffix[] = "-can-create-without-renderer"; | 85 const char suffix[] = "-can-create-without-renderer"; |
| 86 return mime_type.utf8().find(suffix) != std::string::npos; | 86 return mime_type.utf8().find(suffix) != std::string::npos; |
| 87 } | 87 } |
| 88 | 88 |
| 89 void loadURLExternally(const blink::WebURLRequest& request, | 89 void loadURLExternally(const blink::WebURLRequest& request, |
| 90 blink::WebNavigationPolicy policy, | 90 blink::WebNavigationPolicy policy, |
| 91 const blink::WebString& suggested_name, | 91 const blink::WebString& suggested_name, |
| 92 bool replaces_current_history_item) override { | 92 blink::WebFrameLoadType load_type) override { |
| 93 test_client()->loadURLExternally(request, policy, suggested_name, | 93 test_client()->loadURLExternally(request, policy, suggested_name, |
| 94 replaces_current_history_item); | 94 load_type); |
| 95 Base::loadURLExternally(request, policy, suggested_name, | 95 Base::loadURLExternally(request, policy, suggested_name, load_type); |
| 96 replaces_current_history_item); | |
| 97 } | 96 } |
| 98 | 97 |
| 99 void didStartProvisionalLoad(blink::WebLocalFrame* frame) override { | 98 void didStartProvisionalLoad(blink::WebDataSource* data_source, |
| 100 test_client()->didStartProvisionalLoad(frame); | 99 blink::WebFrameLoadType load_type) override { |
| 101 Base::didStartProvisionalLoad(frame); | 100 test_client()->didStartProvisionalLoad(data_source, load_type); |
| 101 Base::didStartProvisionalLoad(data_source, load_type); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void didReceiveServerRedirectForProvisionalLoad( | 104 void didReceiveServerRedirectForProvisionalLoad( |
| 105 blink::WebLocalFrame* frame) override { | 105 blink::WebLocalFrame* frame) override { |
| 106 test_client()->didReceiveServerRedirectForProvisionalLoad(frame); | 106 test_client()->didReceiveServerRedirectForProvisionalLoad(frame); |
| 107 Base::didReceiveServerRedirectForProvisionalLoad(frame); | 107 Base::didReceiveServerRedirectForProvisionalLoad(frame); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void didFailProvisionalLoad( | 110 void didFailProvisionalLoad( |
| 111 blink::WebLocalFrame* frame, | 111 blink::WebLocalFrame* frame, |
| 112 const blink::WebURLError& error, | 112 const blink::WebURLError& error, |
| 113 blink::WebHistoryCommitType commit_type) override { | 113 blink::WebHistoryCommitType commit_type) override { |
| 114 test_client()->didFailProvisionalLoad(frame, error, commit_type); | 114 test_client()->didFailProvisionalLoad(frame, error, commit_type); |
| 115 // If the test finished, don't notify the embedder of the failed load, | 115 // If the test finished, don't notify the embedder of the failed load, |
| 116 // as we already destroyed the document loader. | 116 // as we already destroyed the document loader. |
| 117 if (!frame->provisionalDataSource()) | 117 if (!frame->provisionalDataSource()) |
| 118 return; | 118 return; |
| 119 Base::didFailProvisionalLoad(frame, error, commit_type); | 119 Base::didFailProvisionalLoad(frame, error, commit_type); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void didCommitProvisionalLoad( | 122 void didCommitProvisionalLoad( |
| 123 blink::WebLocalFrame* frame, | 123 blink::WebDataSource* data_source, |
| 124 blink::WebFrameLoadType load_type, |
| 124 const blink::WebHistoryItem& item, | 125 const blink::WebHistoryItem& item, |
| 125 blink::WebHistoryCommitType commit_type) override { | 126 blink::WebHistoryCommitType commit_type) override { |
| 126 test_client()->didCommitProvisionalLoad(frame, item, commit_type); | 127 test_client()->didCommitProvisionalLoad(data_source, load_type, item, |
| 127 Base::didCommitProvisionalLoad(frame, item, commit_type); | 128 commit_type); |
| 129 Base::didCommitProvisionalLoad(data_source, load_type, item, commit_type); |
| 128 } | 130 } |
| 129 | 131 |
| 130 void didReceiveTitle(blink::WebLocalFrame* frame, | 132 void didReceiveTitle(blink::WebLocalFrame* frame, |
| 131 const blink::WebString& title, | 133 const blink::WebString& title, |
| 132 blink::WebTextDirection direction) override { | 134 blink::WebTextDirection direction) override { |
| 133 test_client()->didReceiveTitle(frame, title, direction); | 135 test_client()->didReceiveTitle(frame, title, direction); |
| 134 Base::didReceiveTitle(frame, title, direction); | 136 Base::didReceiveTitle(frame, title, direction); |
| 135 } | 137 } |
| 136 | 138 |
| 137 void didChangeIcon(blink::WebLocalFrame* frame, | 139 void didChangeIcon(blink::WebLocalFrame* frame, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 155 blink::WebHistoryCommitType commit_type) override { | 157 blink::WebHistoryCommitType commit_type) override { |
| 156 test_client()->didFailLoad(frame, error, commit_type); | 158 test_client()->didFailLoad(frame, error, commit_type); |
| 157 Base::didFailLoad(frame, error, commit_type); | 159 Base::didFailLoad(frame, error, commit_type); |
| 158 } | 160 } |
| 159 | 161 |
| 160 void didFinishLoad(blink::WebLocalFrame* frame) override { | 162 void didFinishLoad(blink::WebLocalFrame* frame) override { |
| 161 Base::didFinishLoad(frame); | 163 Base::didFinishLoad(frame); |
| 162 test_client()->didFinishLoad(frame); | 164 test_client()->didFinishLoad(frame); |
| 163 } | 165 } |
| 164 | 166 |
| 165 void didNavigateWithinPage(blink::WebLocalFrame* frame, | 167 void didNavigateWithinPage(blink::WebDataSource* data_source, |
| 168 blink::WebFrameLoadType load_type, |
| 166 const blink::WebHistoryItem& history_item, | 169 const blink::WebHistoryItem& history_item, |
| 167 blink::WebHistoryCommitType commit_type, | 170 blink::WebHistoryCommitType commit_type, |
| 168 bool content_initiated) override { | 171 bool content_initiated) override { |
| 169 Base::didNavigateWithinPage(frame, history_item, commit_type, | 172 Base::didNavigateWithinPage(data_source, load_type, history_item, |
| 170 content_initiated); | 173 commit_type, content_initiated); |
| 171 test_client()->didNavigateWithinPage(frame, history_item, commit_type, | 174 test_client()->didNavigateWithinPage(data_source, load_type, history_item, |
| 172 content_initiated); | 175 commit_type, content_initiated); |
| 173 } | 176 } |
| 174 | 177 |
| 175 void didStopLoading() override { | 178 void didStopLoading() override { |
| 176 Base::didStopLoading(); | 179 Base::didStopLoading(); |
| 177 test_client()->didStopLoading(); | 180 test_client()->didStopLoading(); |
| 178 } | 181 } |
| 179 | 182 |
| 180 void didChangeSelection(bool is_selection_empty) override { | 183 void didChangeSelection(bool is_selection_empty) override { |
| 181 test_client()->didChangeSelection(is_selection_empty); | 184 test_client()->didChangeSelection(is_selection_empty); |
| 182 Base::didChangeSelection(is_selection_empty); | 185 Base::didChangeSelection(is_selection_empty); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 } | 235 } |
| 233 | 236 |
| 234 void didDispatchPingLoader(const blink::WebURL& url) override { | 237 void didDispatchPingLoader(const blink::WebURL& url) override { |
| 235 // This is not implemented in RenderFrameImpl, so need to explicitly call | 238 // This is not implemented in RenderFrameImpl, so need to explicitly call |
| 236 // into the base proxy. | 239 // into the base proxy. |
| 237 test_client()->didDispatchPingLoader(url); | 240 test_client()->didDispatchPingLoader(url); |
| 238 Base::didDispatchPingLoader(url); | 241 Base::didDispatchPingLoader(url); |
| 239 } | 242 } |
| 240 | 243 |
| 241 void willSendRequest(blink::WebLocalFrame* frame, | 244 void willSendRequest(blink::WebLocalFrame* frame, |
| 242 blink::WebURLRequest& request) override { | 245 blink::WebURLRequest& request, |
| 243 Base::willSendRequest(frame, request); | 246 blink::WebFrameLoadType load_type) override { |
| 244 test_client()->willSendRequest(frame, request); | 247 Base::willSendRequest(frame, request, load_type); |
| 248 test_client()->willSendRequest(frame, request, load_type); |
| 245 } | 249 } |
| 246 | 250 |
| 247 void didReceiveResponse(const blink::WebURLResponse& response) override { | 251 void didReceiveResponse(const blink::WebURLResponse& response) override { |
| 248 test_client()->didReceiveResponse(response); | 252 test_client()->didReceiveResponse(response); |
| 249 Base::didReceiveResponse(response); | 253 Base::didReceiveResponse(response); |
| 250 } | 254 } |
| 251 | 255 |
| 252 blink::WebNavigationPolicy decidePolicyForNavigation( | 256 blink::WebNavigationPolicy decidePolicyForNavigation( |
| 253 const blink::WebFrameClient::NavigationPolicyInfo& info) override { | 257 const blink::WebFrameClient::NavigationPolicyInfo& info) override { |
| 254 blink::WebNavigationPolicy policy = | 258 blink::WebNavigationPolicy policy = |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 return test_client()->runFileChooser(params, completion); | 301 return test_client()->runFileChooser(params, completion); |
| 298 } | 302 } |
| 299 | 303 |
| 300 private: | 304 private: |
| 301 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); | 305 DISALLOW_COPY_AND_ASSIGN(WebFrameTestProxy); |
| 302 }; | 306 }; |
| 303 | 307 |
| 304 } // namespace test_runner | 308 } // namespace test_runner |
| 305 | 309 |
| 306 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ | 310 #endif // COMPONENTS_TEST_RUNNER_WEB_FRAME_TEST_PROXY_H_ |
| OLD | NEW |