summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request_unittest.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-18 18:32:45 +0000
committerBen Murdoch <benm@google.com>2010-11-18 18:38:07 +0000
commit513209b27ff55e2841eac0e4120199c23acce758 (patch)
treeaeba30bb08c5f47c57003544e378a377c297eee6 /net/url_request/url_request_unittest.cc
parent164f7496de0fbee436b385a79ead9e3cb81a50c1 (diff)
downloadexternal_chromium-513209b27ff55e2841eac0e4120199c23acce758.zip
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.gz
external_chromium-513209b27ff55e2841eac0e4120199c23acce758.tar.bz2
Merge Chromium at r65505: Initial merge by git.
Change-Id: I31d8f1d8cd33caaf7f47ffa7350aef42d5fbdb45
Diffstat (limited to 'net/url_request/url_request_unittest.cc')
-rw-r--r--net/url_request/url_request_unittest.cc50
1 files changed, 28 insertions, 22 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 3c5d05f..d0f488d 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -69,7 +69,7 @@ bool ContainsString(const std::string& haystack, const char* needle) {
haystack.end(),
needle,
needle + strlen(needle),
- CaseInsensitiveCompare<char>());
+ base::CaseInsensitiveCompare<char>());
return it != haystack.end();
}
@@ -89,7 +89,7 @@ void FillBuffer(char* buffer, size_t len) {
}
scoped_refptr<net::UploadData> CreateSimpleUploadData(const char* data) {
- scoped_refptr<net::UploadData> upload = new net::UploadData;
+ scoped_refptr<net::UploadData> upload(new net::UploadData);
upload->AppendBytes(data, strlen(data));
return upload;
}
@@ -146,7 +146,7 @@ class URLRequestTestHTTP : public URLRequestTest {
}
uploadBytes[kMsgSize] = '\0';
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
for (int i = 0; i < kIterations; ++i) {
TestDelegate d;
@@ -310,7 +310,9 @@ TEST_F(HTTPSRequestTest, HTTPSGetTest) {
}
TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS_MISMATCHED_HOSTNAME,
+ net::TestServer::HTTPSOptions https_options(
+ net::TestServer::HTTPSOptions::CERT_MISMATCHED_NAME);
+ net::TestServer test_server(https_options,
FilePath(FILE_PATH_LITERAL("net/data/ssl")));
ASSERT_TRUE(test_server.Start());
@@ -340,7 +342,9 @@ TEST_F(HTTPSRequestTest, HTTPSMismatchedTest) {
}
TEST_F(HTTPSRequestTest, HTTPSExpiredTest) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS_EXPIRED_CERTIFICATE,
+ net::TestServer::HTTPSOptions https_options(
+ net::TestServer::HTTPSOptions::CERT_EXPIRED);
+ net::TestServer test_server(https_options,
FilePath(FILE_PATH_LITERAL("net/data/ssl")));
ASSERT_TRUE(test_server.Start());
@@ -398,7 +402,9 @@ class SSLClientAuthTestDelegate : public TestDelegate {
// - Getting a certificate request in an SSL renegotiation sending the
// HTTP request.
TEST_F(HTTPSRequestTest, ClientAuthTest) {
- net::TestServer test_server(net::TestServer::TYPE_HTTPS_CLIENT_AUTH,
+ net::TestServer::HTTPSOptions https_options;
+ https_options.request_client_certificate = true;
+ net::TestServer test_server(https_options,
FilePath(FILE_PATH_LITERAL("net/data/ssl")));
ASSERT_TRUE(test_server.Start());
@@ -521,7 +527,7 @@ TEST_F(URLRequestTestHTTP, CancelTest4) {
TEST_F(URLRequestTestHTTP, CancelTest5) {
ASSERT_TRUE(test_server_.Start());
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
// populate cache
{
@@ -1128,7 +1134,7 @@ TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) {
TEST_F(URLRequestTestHTTP, VaryHeader) {
ASSERT_TRUE(test_server_.Start());
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
// populate the cache
{
@@ -1174,7 +1180,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) {
TEST_F(URLRequestTestHTTP, BasicAuth) {
ASSERT_TRUE(test_server_.Start());
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
// populate the cache
{
@@ -1224,7 +1230,7 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
// Request a page that will give a 401 containing a Set-Cookie header.
// Verify that when the transaction is restarted, it includes the new cookie.
{
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
TestDelegate d;
d.set_username(kUser);
d.set_password(kSecret);
@@ -1245,7 +1251,7 @@ TEST_F(URLRequestTestHTTP, BasicAuthWithCookies) {
// Same test as above, except this time the restart is initiated earlier
// (without user intervention since identity is embedded in the URL).
{
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
TestDelegate d;
GURL::Replacements replacements;
@@ -1273,7 +1279,7 @@ TEST_F(URLRequestTest, DoNotSendCookies) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
// Set up a cookie.
{
@@ -1322,7 +1328,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<URLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<URLRequestContext> context(new TestURLRequestContext());
// Set up a cookie.
{
@@ -1378,7 +1384,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
// Set up a cookie.
{
@@ -1432,7 +1438,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
// Set up a cookie.
{
@@ -1489,7 +1495,7 @@ TEST_F(URLRequestTest, DoNotSaveEmptyCookies) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
// Set up an empty cookie.
{
@@ -1509,7 +1515,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
// Set up a cookie.
{
@@ -1564,7 +1570,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
// Set up a cookie.
{
@@ -1621,7 +1627,7 @@ TEST_F(URLRequestTest, CancelTest_During_CookiePolicy) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
TestCookiePolicy cookie_policy(TestCookiePolicy::ASYNC);
context->set_cookie_policy(&cookie_policy);
@@ -1652,7 +1658,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnGetCookies) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
TestCookiePolicy cookie_policy(TestCookiePolicy::NO_GET_COOKIES);
context->set_cookie_policy(&cookie_policy);
@@ -1681,7 +1687,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnSetCookie) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
TestCookiePolicy cookie_policy(TestCookiePolicy::NO_SET_COOKIE);
context->set_cookie_policy(&cookie_policy);
@@ -1715,7 +1721,7 @@ TEST_F(URLRequestTest, CookiePolicy_ForceSession) {
net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath());
ASSERT_TRUE(test_server.Start());
- scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext();
+ scoped_refptr<TestURLRequestContext> context(new TestURLRequestContext());
TestCookiePolicy cookie_policy(TestCookiePolicy::FORCE_SESSION);
context->set_cookie_policy(&cookie_policy);