diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 07:17:30 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 07:17:30 +0000 |
commit | f72a1ccce08050ede3d1e46cbbcd9cf5b3a1c236 (patch) | |
tree | e915476e6da96eb67e56e6ea63c8d05a4280cbee /net/url_request | |
parent | 7e868c9633b4d6f41c8d559625b69ef9fece5b8b (diff) | |
download | chromium_src-f72a1ccce08050ede3d1e46cbbcd9cf5b3a1c236.zip chromium_src-f72a1ccce08050ede3d1e46cbbcd9cf5b3a1c236.tar.gz chromium_src-f72a1ccce08050ede3d1e46cbbcd9cf5b3a1c236.tar.bz2 |
Remove deprecated things from net test suite:
- URLRequestTestContext (from now on use TestURLRequestContext)
- TestServerPageW (use TestServerPage).
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/1814002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_unittest.cc | 40 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.h | 9 |
2 files changed, 20 insertions, 29 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 439851b..2cddb64 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -122,7 +122,7 @@ class URLRequestTestHTTP : public URLRequestTest { } uploadBytes[kMsgSize] = '\0'; - scoped_refptr<URLRequestContext> context = new URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); for (int i = 0; i < kIterations; ++i) { TestDelegate d; @@ -484,7 +484,7 @@ TEST_F(URLRequestTestHTTP, CancelTest4) { TEST_F(URLRequestTestHTTP, CancelTest5) { ASSERT_TRUE(NULL != server_.get()); - scoped_refptr<URLRequestContext> context = new URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); // populate cache { @@ -1085,7 +1085,7 @@ TEST_F(URLRequestTestHTTP, CancelDeferredRedirect) { TEST_F(URLRequestTestHTTP, VaryHeader) { ASSERT_TRUE(NULL != server_.get()); - scoped_refptr<URLRequestContext> context = new URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); // populate the cache { @@ -1123,7 +1123,7 @@ TEST_F(URLRequestTestHTTP, VaryHeader) { } TEST_F(URLRequestTestHTTP, BasicAuth) { - scoped_refptr<URLRequestContext> context = new URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); ASSERT_TRUE(NULL != server_.get()); // populate the cache @@ -1174,7 +1174,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 URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); TestDelegate d; d.set_username(L"user"); d.set_password(L"secret"); @@ -1195,7 +1195,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 URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); TestDelegate d; GURL::Replacements replacements; @@ -1223,7 +1223,7 @@ TEST_F(URLRequestTest, DoNotSendCookies) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestContext> context = new URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); // Set up a cookie. { @@ -1272,7 +1272,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestContext> context = new URLRequestTestContext(); + scoped_refptr<URLRequestContext> context = new TestURLRequestContext(); // Set up a cookie. { @@ -1325,7 +1325,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); // Set up a cookie. { @@ -1379,7 +1379,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); // Set up a cookie. { @@ -1436,7 +1436,7 @@ TEST_F(URLRequestTest, DoNotSendCookies_ViaPolicy_Async) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); // Set up a cookie. { @@ -1491,7 +1491,7 @@ TEST_F(URLRequestTest, DoNotSaveCookies_ViaPolicy_Async) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); // Set up a cookie. { @@ -1548,7 +1548,7 @@ TEST_F(URLRequestTest, CancelTest_During_CookiePolicy) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); TestCookiePolicy cookie_policy(TestCookiePolicy::ASYNC); context->set_cookie_policy(&cookie_policy); @@ -1579,7 +1579,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnGetCookiesBlocked) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); TestCookiePolicy cookie_policy(TestCookiePolicy::NO_GET_COOKIES); context->set_cookie_policy(&cookie_policy); @@ -1608,7 +1608,7 @@ TEST_F(URLRequestTest, CancelTest_During_OnSetCookieBlocked) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); TestCookiePolicy cookie_policy(TestCookiePolicy::NO_SET_COOKIE); context->set_cookie_policy(&cookie_policy); @@ -1642,7 +1642,7 @@ TEST_F(URLRequestTest, CookiePolicy_ForceSession) { scoped_refptr<HTTPTestServer> server = HTTPTestServer::CreateServer(L"", NULL); ASSERT_TRUE(NULL != server.get()); - scoped_refptr<URLRequestTestContext> context = new URLRequestTestContext(); + scoped_refptr<TestURLRequestContext> context = new TestURLRequestContext(); TestCookiePolicy cookie_policy(TestCookiePolicy::FORCE_SESSION); context->set_cookie_policy(&cookie_policy); @@ -2478,7 +2478,7 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptLanguage) { ASSERT_TRUE(NULL != server_.get()); TestDelegate d; TestURLRequest req(server_->TestServerPage("echoheader?Accept-Language"), &d); - req.set_context(new URLRequestTestContext()); + req.set_context(new TestURLRequestContext()); req.Start(); MessageLoop::current()->Run(); EXPECT_EQ(req.context()->accept_language(), d.data_received()); @@ -2491,7 +2491,7 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptLanguage) { TestDelegate d; TestURLRequest req(server_->TestServerPage("echoheaderoverride?Accept-Language"), &d); - req.set_context(new URLRequestTestContext()); + req.set_context(new TestURLRequestContext()); req.SetExtraRequestHeaders("Accept-Language: ru"); req.Start(); MessageLoop::current()->Run(); @@ -2503,7 +2503,7 @@ TEST_F(URLRequestTestHTTP, DefaultAcceptCharset) { ASSERT_TRUE(NULL != server_.get()); TestDelegate d; TestURLRequest req(server_->TestServerPage("echoheader?Accept-Charset"), &d); - req.set_context(new URLRequestTestContext()); + req.set_context(new TestURLRequestContext()); req.Start(); MessageLoop::current()->Run(); EXPECT_EQ(req.context()->accept_charset(), d.data_received()); @@ -2516,7 +2516,7 @@ TEST_F(URLRequestTestHTTP, OverrideAcceptCharset) { TestDelegate d; TestURLRequest req(server_->TestServerPage("echoheaderoverride?Accept-Charset"), &d); - req.set_context(new URLRequestTestContext()); + req.set_context(new TestURLRequestContext()); req.SetExtraRequestHeaders("Accept-Charset: koi-8r"); req.Start(); MessageLoop::current()->Run(); diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h index 8b496f8b..4861046 100644 --- a/net/url_request/url_request_unittest.h +++ b/net/url_request/url_request_unittest.h @@ -174,9 +174,6 @@ class TestURLRequestContext : public URLRequestContext { } }; -// TODO(phajdan.jr): Migrate callers to the new name and remove the typedef. -typedef TestURLRequestContext URLRequestTestContext; - //----------------------------------------------------------------------------- class TestURLRequest : public URLRequest { @@ -431,12 +428,6 @@ class BaseTestServer : public base::RefCounted<BaseTestServer> { "@" + host_name_ + ":" + port_str_ + "/" + path); } - // Deprecated in favor of TestServerPage. - // TODO(phajdan.jr): Remove TestServerPageW. - GURL TestServerPageW(const std::wstring& path) { - return TestServerPage(WideToUTF8(path)); - } - virtual bool MakeGETRequest(const std::string& page_name) = 0; FilePath GetDataDirectory() { |