Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Unified Diff: components/test_runner/web_frame_test_client.cc

Issue 2211283004: Drop test-only WebFrameClient params/functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/test_runner/web_frame_test_client.h ('k') | components/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/web_frame_test_client.cc
diff --git a/components/test_runner/web_frame_test_client.cc b/components/test_runner/web_frame_test_client.cc
index 6991e9a3499a677530230c38f3476f23cf685aae..97f704b78286454d468959a2c408ef7bdb215eca 100644
--- a/components/test_runner/web_frame_test_client.cc
+++ b/components/test_runner/web_frame_test_client.cc
@@ -96,25 +96,6 @@ void PrintResponseDescription(WebTestDelegate* delegate,
response.httpStatusCode()));
}
-std::string PriorityDescription(
- const blink::WebURLRequest::Priority& priority) {
- switch (priority) {
- case blink::WebURLRequest::PriorityVeryLow:
- return "VeryLow";
- case blink::WebURLRequest::PriorityLow:
- return "Low";
- case blink::WebURLRequest::PriorityMedium:
- return "Medium";
- case blink::WebURLRequest::PriorityHigh:
- return "High";
- case blink::WebURLRequest::PriorityVeryHigh:
- return "VeryHigh";
- case blink::WebURLRequest::PriorityUnresolved:
- default:
- return "Unresolved";
- }
-}
-
void BlockRequest(blink::WebURLRequest& request) {
request.setURL(GURL("255.255.255.255"));
}
@@ -541,32 +522,16 @@ void WebFrameTestClient::didDispatchPingLoader(const blink::WebURL& url) {
URLDescription(url).c_str() + "'.\n");
}
-void WebFrameTestClient::willSendRequest(
- blink::WebLocalFrame* frame,
- unsigned identifier,
- blink::WebURLRequest& request,
- const blink::WebURLResponse& redirect_response) {
+void WebFrameTestClient::willSendRequest(blink::WebLocalFrame* frame,
+ blink::WebURLRequest& request) {
// Need to use GURL for host() and SchemeIs()
GURL url = request.url();
std::string request_url = url.possibly_invalid_spec();
GURL main_document_url = request.firstPartyForCookies();
- if (redirect_response.isNull() &&
- (test_runner_->shouldDumpResourceLoadCallbacks() ||
- test_runner_->shouldDumpResourcePriorities())) {
- DCHECK(resource_identifier_map_.find(identifier) ==
- resource_identifier_map_.end());
- resource_identifier_map_[identifier] =
- DescriptionSuitableForTestResult(request_url);
- }
-
if (test_runner_->shouldDumpResourceLoadCallbacks()) {
- if (resource_identifier_map_.find(identifier) ==
- resource_identifier_map_.end())
- delegate_->PrintMessage("<unknown>");
- else
- delegate_->PrintMessage(resource_identifier_map_[identifier]);
+ delegate_->PrintMessage(DescriptionSuitableForTestResult(request_url));
delegate_->PrintMessage(" - willSendRequest <NSURLRequest URL ");
delegate_->PrintMessage(
DescriptionSuitableForTestResult(request_url).c_str());
@@ -574,17 +539,7 @@ void WebFrameTestClient::willSendRequest(
delegate_->PrintMessage(URLDescription(main_document_url).c_str());
delegate_->PrintMessage(", http method ");
delegate_->PrintMessage(request.httpMethod().utf8().data());
- delegate_->PrintMessage("> redirectResponse ");
- PrintResponseDescription(delegate_, redirect_response);
- delegate_->PrintMessage("\n");
- }
-
- if (test_runner_->shouldDumpResourcePriorities()) {
- delegate_->PrintMessage(
- DescriptionSuitableForTestResult(request_url).c_str());
- delegate_->PrintMessage(" has priority ");
- delegate_->PrintMessage(PriorityDescription(request.getPriority()));
- delegate_->PrintMessage("\n");
+ delegate_->PrintMessage(">\n");
}
if (test_runner_->httpHeadersToClear()) {
@@ -618,14 +573,10 @@ void WebFrameTestClient::willSendRequest(
}
void WebFrameTestClient::didReceiveResponse(
- unsigned identifier,
const blink::WebURLResponse& response) {
if (test_runner_->shouldDumpResourceLoadCallbacks()) {
- if (resource_identifier_map_.find(identifier) ==
- resource_identifier_map_.end())
- delegate_->PrintMessage("<unknown>");
- else
- delegate_->PrintMessage(resource_identifier_map_[identifier]);
+ delegate_->PrintMessage(DescriptionSuitableForTestResult(
+ GURL(response.url()).possibly_invalid_spec()));
delegate_->PrintMessage(" - didReceiveResponse ");
PrintResponseDescription(delegate_, response);
delegate_->PrintMessage("\n");
@@ -643,35 +594,6 @@ void WebFrameTestClient::didReceiveResponse(
}
}
-void WebFrameTestClient::didChangeResourcePriority(
- unsigned identifier,
- const blink::WebURLRequest::Priority& priority,
- int intra_priority_value) {
- if (test_runner_->shouldDumpResourcePriorities()) {
- if (resource_identifier_map_.find(identifier) ==
- resource_identifier_map_.end())
- delegate_->PrintMessage("<unknown>");
- else
- delegate_->PrintMessage(resource_identifier_map_[identifier]);
- delegate_->PrintMessage(base::StringPrintf(
- " changed priority to %s, intra_priority %d\n",
- PriorityDescription(priority).c_str(), intra_priority_value));
- }
-}
-
-void WebFrameTestClient::didFinishResourceLoad(blink::WebLocalFrame* frame,
- unsigned identifier) {
- if (test_runner_->shouldDumpResourceLoadCallbacks()) {
- if (resource_identifier_map_.find(identifier) ==
- resource_identifier_map_.end())
- delegate_->PrintMessage("<unknown>");
- else
- delegate_->PrintMessage(resource_identifier_map_[identifier]);
- delegate_->PrintMessage(" - didFinishLoading\n");
- }
- resource_identifier_map_.erase(identifier);
-}
-
void WebFrameTestClient::didAddMessageToConsole(
const blink::WebConsoleMessage& message,
const blink::WebString& source_name,
« no previous file with comments | « components/test_runner/web_frame_test_client.h ('k') | components/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698