| 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 #include "components/test_runner/web_test_proxy.h" | 5 #include "components/test_runner/web_test_proxy.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 | 1077 |
| 1078 void WebTestProxyBase::DidReceiveServerRedirectForProvisionalLoad( | 1078 void WebTestProxyBase::DidReceiveServerRedirectForProvisionalLoad( |
| 1079 blink::WebLocalFrame* frame) { | 1079 blink::WebLocalFrame* frame) { |
| 1080 if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { | 1080 if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { |
| 1081 PrintFrameDescription(delegate_, frame); | 1081 PrintFrameDescription(delegate_, frame); |
| 1082 delegate_->PrintMessage( | 1082 delegate_->PrintMessage( |
| 1083 " - didReceiveServerRedirectForProvisionalLoadForFrame\n"); | 1083 " - didReceiveServerRedirectForProvisionalLoadForFrame\n"); |
| 1084 } | 1084 } |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 bool WebTestProxyBase::DidFailProvisionalLoad( | 1087 void WebTestProxyBase::DidFailProvisionalLoad( |
| 1088 blink::WebLocalFrame* frame, | 1088 blink::WebLocalFrame* frame, |
| 1089 const blink::WebURLError& error, | 1089 const blink::WebURLError& error, |
| 1090 blink::WebHistoryCommitType commit_type) { | 1090 blink::WebHistoryCommitType commit_type) { |
| 1091 if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { | 1091 if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { |
| 1092 PrintFrameDescription(delegate_, frame); | 1092 PrintFrameDescription(delegate_, frame); |
| 1093 delegate_->PrintMessage(" - didFailProvisionalLoadWithError\n"); | 1093 delegate_->PrintMessage(" - didFailProvisionalLoadWithError\n"); |
| 1094 } | 1094 } |
| 1095 CheckDone(frame, MainResourceLoadFailed); | 1095 CheckDone(frame, MainResourceLoadFailed); |
| 1096 return !frame->provisionalDataSource(); | |
| 1097 } | 1096 } |
| 1098 | 1097 |
| 1099 void WebTestProxyBase::DidCommitProvisionalLoad( | 1098 void WebTestProxyBase::DidCommitProvisionalLoad( |
| 1100 blink::WebLocalFrame* frame, | 1099 blink::WebLocalFrame* frame, |
| 1101 const blink::WebHistoryItem& history_item, | 1100 const blink::WebHistoryItem& history_item, |
| 1102 blink::WebHistoryCommitType history_type) { | 1101 blink::WebHistoryCommitType history_type) { |
| 1103 if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { | 1102 if (test_interfaces_->GetTestRunner()->shouldDumpFrameLoadCallbacks()) { |
| 1104 PrintFrameDescription(delegate_, frame); | 1103 PrintFrameDescription(delegate_, frame); |
| 1105 delegate_->PrintMessage(" - didCommitLoadForFrame\n"); | 1104 delegate_->PrintMessage(" - didCommitLoadForFrame\n"); |
| 1106 } | 1105 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 } | 1168 } |
| 1170 | 1169 |
| 1171 void WebTestProxyBase::DidDispatchPingLoader(blink::WebLocalFrame* frame, | 1170 void WebTestProxyBase::DidDispatchPingLoader(blink::WebLocalFrame* frame, |
| 1172 const blink::WebURL& url) { | 1171 const blink::WebURL& url) { |
| 1173 if (test_interfaces_->GetTestRunner()->shouldDumpPingLoaderCallbacks()) | 1172 if (test_interfaces_->GetTestRunner()->shouldDumpPingLoaderCallbacks()) |
| 1174 delegate_->PrintMessage(std::string("PingLoader dispatched to '") + | 1173 delegate_->PrintMessage(std::string("PingLoader dispatched to '") + |
| 1175 URLDescription(url).c_str() + "'.\n"); | 1174 URLDescription(url).c_str() + "'.\n"); |
| 1176 } | 1175 } |
| 1177 | 1176 |
| 1178 void WebTestProxyBase::WillSendRequest( | 1177 void WebTestProxyBase::WillSendRequest( |
| 1179 blink::WebLocalFrame* frame, | |
| 1180 unsigned identifier, | 1178 unsigned identifier, |
| 1181 blink::WebURLRequest& request, | 1179 blink::WebURLRequest& request, |
| 1182 const blink::WebURLResponse& redirect_response) { | 1180 const blink::WebURLResponse& redirect_response) { |
| 1183 // Need to use GURL for host() and SchemeIs() | 1181 // Need to use GURL for host() and SchemeIs() |
| 1184 GURL url = request.url(); | 1182 GURL url = request.url(); |
| 1185 std::string request_url = url.possibly_invalid_spec(); | 1183 std::string request_url = url.possibly_invalid_spec(); |
| 1186 | 1184 |
| 1187 GURL main_document_url = request.firstPartyForCookies(); | 1185 GURL main_document_url = request.firstPartyForCookies(); |
| 1188 | 1186 |
| 1189 if (redirect_response.isNull() && | 1187 if (redirect_response.isNull() && |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1419 // to cancel the input method's ongoing composition session. | 1417 // to cancel the input method's ongoing composition session. |
| 1420 if (web_widget_) | 1418 if (web_widget_) |
| 1421 web_widget_->confirmComposition(); | 1419 web_widget_->confirmComposition(); |
| 1422 } | 1420 } |
| 1423 | 1421 |
| 1424 blink::WebString WebTestProxyBase::acceptLanguages() { | 1422 blink::WebString WebTestProxyBase::acceptLanguages() { |
| 1425 return blink::WebString::fromUTF8(accept_languages_); | 1423 return blink::WebString::fromUTF8(accept_languages_); |
| 1426 } | 1424 } |
| 1427 | 1425 |
| 1428 } // namespace test_runner | 1426 } // namespace test_runner |
| OLD | NEW |