summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 20:42:51 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 20:42:51 +0000
commit0d282c2e73b39d58ed920177dd53211238dbd211 (patch)
tree82ae5fc3f6a5e8a5a1ff8b34c58a815bc617f787 /chrome
parent56235c632f18380a4455b6ea113cd6e2a2df0d69 (diff)
downloadchromium_src-0d282c2e73b39d58ed920177dd53211238dbd211.zip
chromium_src-0d282c2e73b39d58ed920177dd53211238dbd211.tar.gz
chromium_src-0d282c2e73b39d58ed920177dd53211238dbd211.tar.bz2
Fix for the HTTPSGetTest and GetTest net test failures with ChromeFrame. These failures occurred
because of new expectations in these tests which match the server ip address and port being connected to. We need to return that information from ChromeFrame. Fix is to send over the corresponding HostPortPair structure in the AutomationMsg_RequestStarted IPC message. A major part of this CL is basically the groundwork to pass this information over via automation. BUG=none TEST=chrome frame net tests should pass. Review URL: http://codereview.chromium.org/6575027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/automation/url_request_automation_job.cc6
-rw-r--r--chrome/browser/automation/url_request_automation_job.h5
-rw-r--r--chrome/common/automation_messages.cc21
-rw-r--r--chrome/common/automation_messages.h5
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc7
5 files changed, 32 insertions, 12 deletions
diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc
index 0d06a0e..20430df 100644
--- a/chrome/browser/automation/url_request_automation_job.cc
+++ b/chrome/browser/automation/url_request_automation_job.cc
@@ -14,6 +14,7 @@
#include "chrome/browser/renderer_host/resource_dispatcher_host_request_info.h"
#include "chrome/common/automation_messages.h"
#include "net/base/cookie_monster.h"
+#include "net/base/host_port_pair.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
@@ -248,6 +249,10 @@ uint64 URLRequestAutomationJob::GetUploadProgress() const {
return 0;
}
+net::HostPortPair URLRequestAutomationJob::GetSocketAddress() const {
+ return socket_address_;
+}
+
bool URLRequestAutomationJob::MayFilterMessage(const IPC::Message& message,
int* request_id) {
switch (message.type()) {
@@ -296,6 +301,7 @@ void URLRequestAutomationJob::OnRequestStarted(
net::HttpUtil::AssembleRawHeaders(response.headers.data(),
response.headers.size()));
}
+ socket_address_ = response.socket_address;
NotifyHeadersComplete();
}
diff --git a/chrome/browser/automation/url_request_automation_job.h b/chrome/browser/automation/url_request_automation_job.h
index 9dab13a..e9dd127 100644
--- a/chrome/browser/automation/url_request_automation_job.h
+++ b/chrome/browser/automation/url_request_automation_job.h
@@ -18,6 +18,7 @@ struct AutomationURLResponse;
namespace net {
class HttpResponseHeaders;
class HttpResponseInfo;
+class HostPortPair;
}
namespace IPC {
@@ -46,6 +47,7 @@ class URLRequestAutomationJob : public net::URLRequestJob {
virtual int GetResponseCode() const;
virtual bool IsRedirectResponse(GURL* location, int* http_status_code);
virtual uint64 GetUploadProgress() const;
+ virtual net::HostPortPair GetSocketAddress() const;
// Peek and process automation messages for URL requests.
static bool MayFilterMessage(const IPC::Message& message, int* request_id);
@@ -123,6 +125,9 @@ class URLRequestAutomationJob : public net::URLRequestJob {
// stack when we receive a Read request for a completed job.
net::URLRequestStatus request_status_;
+ // Contains the ip address and port of the destination host.
+ net::HostPortPair socket_address_;
+
ScopedRunnableMethodFactory<URLRequestAutomationJob> method_factory_;
DISALLOW_COPY_AND_ASSIGN(URLRequestAutomationJob);
diff --git a/chrome/common/automation_messages.cc b/chrome/common/automation_messages.cc
index 8dcac0e..f5f1ccc 100644
--- a/chrome/common/automation_messages.cc
+++ b/chrome/common/automation_messages.cc
@@ -5,7 +5,6 @@
#define IPC_MESSAGE_IMPL
#include "chrome/common/automation_messages.h"
-
AutomationURLRequest::AutomationURLRequest()
: resource_type(0),
load_flags(0) {
@@ -35,18 +34,18 @@ AutomationURLResponse::AutomationURLResponse()
redirect_status(0) {
}
-AutomationURLResponse::AutomationURLResponse(const std::string& in_mime_type,
- const std::string& in_headers,
- int64 in_content_length,
- const base::Time& in_last_modified,
- const std::string& in_redirect_url,
- int in_redirect_status)
+AutomationURLResponse::AutomationURLResponse(
+ const std::string& in_mime_type, const std::string& in_headers,
+ int64 in_content_length, const base::Time& in_last_modified,
+ const std::string& in_redirect_url, int in_redirect_status,
+ const net::HostPortPair& host_socket_address)
: mime_type(in_mime_type),
headers(in_headers),
content_length(in_content_length),
last_modified(in_last_modified),
redirect_url(in_redirect_url),
- redirect_status(in_redirect_status) {
+ redirect_status(in_redirect_status),
+ socket_address(host_socket_address) {
}
@@ -445,6 +444,7 @@ void ParamTraits<AutomationURLResponse>::Write(Message* m,
WriteParam(m, p.last_modified);
WriteParam(m, p.redirect_url);
WriteParam(m, p.redirect_status);
+ WriteParam(m, p.socket_address);
}
// static
@@ -456,7 +456,8 @@ bool ParamTraits<AutomationURLResponse>::Read(const Message* m,
ReadParam(m, iter, &p->content_length) &&
ReadParam(m, iter, &p->last_modified) &&
ReadParam(m, iter, &p->redirect_url) &&
- ReadParam(m, iter, &p->redirect_status);
+ ReadParam(m, iter, &p->redirect_status) &&
+ ReadParam(m, iter, &p->socket_address);
}
// static
@@ -474,6 +475,8 @@ void ParamTraits<AutomationURLResponse>::Log(const param_type& p,
LogParam(p.redirect_url, l);
l->append(", ");
LogParam(p.redirect_status, l);
+ l->append(", ");
+ LogParam(p.socket_address, l);
l->append(")");
}
diff --git a/chrome/common/automation_messages.h b/chrome/common/automation_messages.h
index 8bc8153..14ede2a 100644
--- a/chrome/common/automation_messages.h
+++ b/chrome/common/automation_messages.h
@@ -14,6 +14,7 @@
#include "chrome/common/page_type.h"
#include "chrome/common/security_style.h"
#include "chrome/common/common_param_traits.h"
+#include "net/base/host_port_pair.h"
#include "net/base/upload_data.h"
#include "ui/gfx/rect.h"
@@ -41,7 +42,8 @@ struct AutomationURLResponse {
int64 content_length,
const base::Time& last_modified,
const std::string& redirect_url,
- int redirect_status);
+ int redirect_status,
+ const net::HostPortPair& host_socket_address);
~AutomationURLResponse();
std::string mime_type;
@@ -50,6 +52,7 @@ struct AutomationURLResponse {
base::Time last_modified;
std::string redirect_url;
int redirect_status;
+ net::HostPortPair socket_address;
};
struct ExternalTabSettings {
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index cd34c8f..06e082d 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -34,6 +34,7 @@
#include "chrome/test/automation/window_proxy.h"
#include "chrome/test/ui_test_utils.h"
#include "chrome/test/ui/ui_test.h"
+#include "net/base/host_port_pair.h"
#include "net/base/net_util.h"
#include "net/test/test_server.h"
#define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING
@@ -701,7 +702,8 @@ void ExternalTabUITestMockClient::ReplyEnd(const net::URLRequestStatus& status,
void ExternalTabUITestMockClient::Reply404(int tab_handle, int request_id) {
const AutomationURLResponse notfound("", "HTTP/1.1 404\r\n\r\n", 0,
- base::Time(), "", 0);
+ base::Time(), "", 0,
+ net::HostPortPair());
ReplyStarted(&notfound, tab_handle, request_id);
ReplyEOF(tab_handle, request_id);
}
@@ -766,7 +768,8 @@ const AutomationURLResponse ExternalTabUITestMockClient::http_200(
0,
base::Time(),
"",
- 0);
+ 0,
+ net::HostPortPair());
bool ExternalTabUITestMockClient::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;