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

Unified Diff: webkit/appcache/appcache_update_job_unittest.cc

Issue 5384002: net: Remove typedef net::URLRequest URLRequest; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 10 years, 1 month 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
Index: webkit/appcache/appcache_update_job_unittest.cc
diff --git a/webkit/appcache/appcache_update_job_unittest.cc b/webkit/appcache/appcache_update_job_unittest.cc
index defe9f7220add7a420c2d3985ddfaa924e8f8310..543ece5d6b25139dca914467af343df7d1cdf0d7 100644
--- a/webkit/appcache/appcache_update_job_unittest.cc
+++ b/webkit/appcache/appcache_update_job_unittest.cc
@@ -41,7 +41,7 @@ class MockHttpServer {
return GURL("http://mockhost/" + path);
}
- static URLRequestJob* JobFactory(URLRequest* request,
+ static URLRequestJob* JobFactory(net::URLRequest* request,
const std::string& scheme) {
if (request->url().host() != "mockhost")
return new URLRequestErrorJob(request, -1);
@@ -287,7 +287,7 @@ class MockFrontend : public AppCacheFrontend {
};
// Helper factories to simulate redirected URL responses for tests.
-static URLRequestJob* RedirectFactory(URLRequest* request,
+static URLRequestJob* RedirectFactory(net::URLRequest* request,
const std::string& scheme) {
return new URLRequestTestJob(request,
URLRequestTestJob::test_redirect_headers(),
@@ -322,7 +322,7 @@ class RetryRequestTestJob : public URLRequestTestJob {
expected_requests_ = 0;
}
- static URLRequestJob* RetryFactory(URLRequest* request,
+ static URLRequestJob* RetryFactory(net::URLRequest* request,
const std::string& scheme) {
++num_requests_;
if (num_retries_ > 0 && request->original_url() == kRetryUrl) {
@@ -377,7 +377,8 @@ class RetryRequestTestJob : public URLRequestTestJob {
"http://retry\r"); // must be same as kRetryUrl
}
- explicit RetryRequestTestJob(URLRequest* request, const std::string& headers,
+ explicit RetryRequestTestJob(net::URLRequest* request,
+ const std::string& headers,
int response_code)
: URLRequestTestJob(request, headers, data(), true),
response_code_(response_code) {
@@ -423,7 +424,7 @@ class HttpHeadersRequestTestJob : public URLRequestTestJob {
already_checked_ = false;
}
- static URLRequestJob* IfModifiedSinceFactory(URLRequest* request,
+ static URLRequestJob* IfModifiedSinceFactory(net::URLRequest* request,
const std::string& scheme) {
if (!already_checked_) {
already_checked_ = true; // only check once for a test
@@ -477,17 +478,17 @@ class IOThread : public base::Thread {
}
virtual void Init() {
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", MockHttpServer::JobFactory);
request_context_ = new TestURLRequestContext();
}
virtual void CleanUp() {
- URLRequest::RegisterProtocolFactory("http", old_factory_);
+ net::URLRequest::RegisterProtocolFactory("http", old_factory_);
request_context_ = NULL;
}
- URLRequest::ProtocolFactory* old_factory_;
+ net::URLRequest::ProtocolFactory* old_factory_;
scoped_refptr<URLRequestContext> request_context_;
};
@@ -790,7 +791,7 @@ class AppCacheUpdateJobTest : public testing::Test,
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
old_factory_ =
- URLRequest::RegisterProtocolFactory("http", RedirectFactory);
+ net::URLRequest::RegisterProtocolFactory("http", RedirectFactory);
registered_factory_ = true;
MakeService();
@@ -1581,7 +1582,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// Set some large number of times to return retry.
// Expect 1 manifest fetch and 3 retries.
RetryRequestTestJob::Initialize(5, RetryRequestTestJob::RETRY_AFTER_0, 4);
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", RetryRequestTestJob::RetryFactory);
registered_factory_ = true;
@@ -1612,7 +1613,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// Set some large number of times to return retry.
// Expect 1 manifest fetch and 0 retries.
RetryRequestTestJob::Initialize(5, RetryRequestTestJob::NO_RETRY_AFTER, 1);
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", RetryRequestTestJob::RetryFactory);
registered_factory_ = true;
@@ -1644,7 +1645,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// Expect 1 request and 0 retry attempts.
RetryRequestTestJob::Initialize(
5, RetryRequestTestJob::NONZERO_RETRY_AFTER, 1);
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", RetryRequestTestJob::RetryFactory);
registered_factory_ = true;
@@ -1675,7 +1676,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// Set 2 as the retry limit (does not exceed the max).
// Expect 1 manifest fetch, 2 retries, 1 url fetch, 1 manifest refetch.
RetryRequestTestJob::Initialize(2, RetryRequestTestJob::RETRY_AFTER_0, 5);
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", RetryRequestTestJob::RetryFactory);
registered_factory_ = true;
@@ -1706,7 +1707,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// Set 1 as the retry limit (does not exceed the max).
// Expect 1 manifest fetch, 1 url fetch, 1 url retry, 1 manifest refetch.
RetryRequestTestJob::Initialize(1, RetryRequestTestJob::RETRY_AFTER_0, 4);
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", RetryRequestTestJob::RetryFactory);
registered_factory_ = true;
@@ -2547,7 +2548,7 @@ class AppCacheUpdateJobTest : public testing::Test,
void IfModifiedSinceTest() {
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", HttpHeadersRequestTestJob::IfModifiedSinceFactory);
registered_factory_ = true;
@@ -2613,7 +2614,7 @@ class AppCacheUpdateJobTest : public testing::Test,
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
HttpHeadersRequestTestJob::Initialize("Sat, 29 Oct 1994 19:43:31 GMT", "");
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", HttpHeadersRequestTestJob::IfModifiedSinceFactory);
registered_factory_ = true;
@@ -2671,7 +2672,7 @@ class AppCacheUpdateJobTest : public testing::Test,
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\"");
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", HttpHeadersRequestTestJob::IfModifiedSinceFactory);
registered_factory_ = true;
@@ -2729,7 +2730,7 @@ class AppCacheUpdateJobTest : public testing::Test,
ASSERT_EQ(MessageLoop::TYPE_IO, MessageLoop::current()->type());
HttpHeadersRequestTestJob::Initialize("", "\"LadeDade\"");
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", HttpHeadersRequestTestJob::IfModifiedSinceFactory);
registered_factory_ = true;
@@ -2764,7 +2765,7 @@ class AppCacheUpdateJobTest : public testing::Test,
// Verify that code is correct when building multiple extra headers.
HttpHeadersRequestTestJob::Initialize(
"Sat, 29 Oct 1994 19:43:31 GMT", "\"LadeDade\"");
- old_factory_ = URLRequest::RegisterProtocolFactory(
+ old_factory_ = net::URLRequest::RegisterProtocolFactory(
"http", HttpHeadersRequestTestJob::IfModifiedSinceFactory);
registered_factory_ = true;
@@ -2831,7 +2832,7 @@ class AppCacheUpdateJobTest : public testing::Test,
response_infos_.clear();
service_.reset(NULL);
if (registered_factory_)
- URLRequest::RegisterProtocolFactory("http", old_factory_);
+ net::URLRequest::RegisterProtocolFactory("http", old_factory_);
event_->Signal();
}
@@ -3180,7 +3181,7 @@ class AppCacheUpdateJobTest : public testing::Test,
std::map<GURL, int64> expect_response_ids_;
bool registered_factory_;
- URLRequest::ProtocolFactory* old_factory_;
+ net::URLRequest::ProtocolFactory* old_factory_;
};
// static

Powered by Google App Engine
This is Rietveld 408576698