summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
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_frame/test
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_frame/test')
-rw-r--r--chrome_frame/test/automation_client_mock.h2
-rw-r--r--chrome_frame/test/url_request_test.cc20
2 files changed, 13 insertions, 9 deletions
diff --git a/chrome_frame/test/automation_client_mock.h b/chrome_frame/test/automation_client_mock.h
index 39d2f32..52a1ce63 100644
--- a/chrome_frame/test/automation_client_mock.h
+++ b/chrome_frame/test/automation_client_mock.h
@@ -65,7 +65,7 @@ struct MockCFDelegate : public ChromeFrameDelegateImpl {
void ReplyStarted(int request_id, const char* headers) {
request_delegate_->OnResponseStarted(request_id, "text/html", headers,
- 0, base::Time::Now(), EmptyString(), 0);
+ 0, base::Time::Now(), EmptyString(), 0, net::HostPortPair());
}
void ReplyData(int request_id, const std::string* data) {
diff --git a/chrome_frame/test/url_request_test.cc b/chrome_frame/test/url_request_test.cc
index a7edb8c..a4a32cd 100644
--- a/chrome_frame/test/url_request_test.cc
+++ b/chrome_frame/test/url_request_test.cc
@@ -37,9 +37,10 @@ static void AppendToStream(IStream* s, void* buffer, ULONG cb) {
class MockUrlDelegate : public PluginUrlRequestDelegate {
public:
- MOCK_METHOD7(OnResponseStarted, void(int request_id, const char* mime_type,
+ MOCK_METHOD8(OnResponseStarted, void(int request_id, const char* mime_type,
const char* headers, int size, base::Time last_modified,
- const std::string& redirect_url, int redirect_status));
+ const std::string& redirect_url, int redirect_status,
+ const net::HostPortPair& socket_address));
MOCK_METHOD2(OnReadComplete, void(int request_id, const std::string& data));
MOCK_METHOD2(OnResponseEnd, void(int request_id,
const net::URLRequestStatus& status));
@@ -89,7 +90,8 @@ TEST(UrlmonUrlRequestTest, Simple1) {
testing::InSequence s;
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
- testing::_, testing::_, testing::_))
+ testing::_, testing::_, testing::_,
+ testing::_))
.Times(1)
.WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor(
&request, &UrlmonUrlRequest::Read, 512))));
@@ -137,7 +139,8 @@ TEST(UrlmonUrlRequestTest, Head) {
testing::InSequence s;
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
- testing::_, testing::_, testing::_))
+ testing::_, testing::_, testing::_,
+ testing::_))
.Times(1)
.WillOnce(testing::IgnoreResult(testing::InvokeWithoutArgs(CreateFunctor(
&request, &UrlmonUrlRequest::Read, 512))));
@@ -181,7 +184,7 @@ TEST(UrlmonUrlRequestTest, UnreachableUrl) {
EXPECT_CALL(mock, OnResponseStarted(1, testing::_,
testing::StartsWith("HTTP/1.1 404"),
testing::_, testing::_, testing::_,
- testing::_))
+ testing::_, testing::_))
.Times(1)
.WillOnce(QUIT_LOOP_SOON(loop, 2));
@@ -218,7 +221,8 @@ TEST(UrlmonUrlRequestTest, ZeroLengthResponse) {
// Expect headers
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
- testing::_, testing::_, testing::_))
+ testing::_, testing::_, testing::_,
+ testing::_))
.Times(1)
.WillOnce(QUIT_LOOP(loop));
@@ -265,7 +269,7 @@ TEST(UrlmonUrlRequestManagerTest, Simple1) {
"get", "", "", NULL, 0, 0);
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
- testing::_, testing::_, testing::_))
+ testing::_, testing::_, testing::_, testing::_))
.Times(1)
.WillOnce(ManagerRead(&loop, mgr.get(), 1, 512));
@@ -298,7 +302,7 @@ TEST(UrlmonUrlRequestManagerTest, Abort1) {
"get", "", "", NULL, 0, 0);
EXPECT_CALL(mock, OnResponseStarted(1, testing::_, testing::_, testing::_,
- testing::_, testing::_, testing::_))
+ testing::_, testing::_, testing::_, testing::_))
.Times(1)
.WillOnce(testing::DoAll(
ManagerEndRequest(&loop, mgr.get(), 1),