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

Unified Diff: components/update_client/test/url_request_post_interceptor.cc

Issue 808773005: Move most of the component updater artifacts to update_client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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: components/update_client/test/url_request_post_interceptor.cc
diff --git a/components/component_updater/test/url_request_post_interceptor.cc b/components/update_client/test/url_request_post_interceptor.cc
similarity index 92%
rename from components/component_updater/test/url_request_post_interceptor.cc
rename to components/update_client/test/url_request_post_interceptor.cc
index f2dc839ccd0492ea03b3528108b79d01f0e7e0ae..4aeb7a7f5ed205d532aa6b0053bb19a0ecc60a1b 100644
--- a/components/component_updater/test/url_request_post_interceptor.cc
+++ b/components/update_client/test/url_request_post_interceptor.cc
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/component_updater/test/url_request_post_interceptor.h"
+#include "components/update_client/test/url_request_post_interceptor.h"
#include "base/files/file_util.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
-#include "components/component_updater/test/test_configurator.h"
+#include "components/update_client/test/test_configurator.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/base/upload_data_stream.h"
#include "net/url_request/url_request.h"
@@ -17,7 +17,7 @@
#include "net/url_request/url_request_simple_job.h"
#include "net/url_request/url_request_test_util.h"
-namespace component_updater {
+namespace update_client {
// Returns a canned response.
class URLRequestMockJob : public net::URLRequestSimpleJob {
@@ -123,8 +123,7 @@ std::string URLRequestPostInterceptor::GetRequestsAsString() const {
int i = 0;
for (std::vector<std::string>::const_iterator it = requests.begin();
- it != requests.end();
- ++it) {
+ it != requests.end(); ++it) {
s.append(base::StringPrintf("\n (%d): %s", ++i, it->c_str()));
}
@@ -154,8 +153,7 @@ class URLRequestPostInterceptor::Delegate : public net::URLRequestInterceptor {
void Unregister() {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
for (InterceptorMap::iterator it = interceptors_.begin();
- it != interceptors_.end();
- ++it)
+ it != interceptors_.end(); ++it)
delete (*it).second;
net::URLRequestFilter::GetInstance()->RemoveHostnameHandler(scheme_,
hostname_);
@@ -218,8 +216,8 @@ class URLRequestPostInterceptor::Delegate : public net::URLRequestInterceptor {
interceptor->expectations_.pop();
++interceptor->hit_count_;
- return new URLRequestMockJob(
- request, network_delegate, response_code, response_body);
+ return new URLRequestMockJob(request, network_delegate, response_code,
+ response_body);
}
}
@@ -247,16 +245,14 @@ URLRequestPostInterceptorFactory::URLRequestPostInterceptorFactory(
hostname,
io_task_runner)) {
io_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&URLRequestPostInterceptor::Delegate::Register,
- base::Unretained(delegate_)));
+ FROM_HERE, base::Bind(&URLRequestPostInterceptor::Delegate::Register,
+ base::Unretained(delegate_)));
}
URLRequestPostInterceptorFactory::~URLRequestPostInterceptorFactory() {
io_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&URLRequestPostInterceptor::Delegate::Unregister,
- base::Unretained(delegate_)));
+ FROM_HERE, base::Bind(&URLRequestPostInterceptor::Delegate::Unregister,
+ base::Unretained(delegate_)));
}
URLRequestPostInterceptor* URLRequestPostInterceptorFactory::CreateInterceptor(
@@ -269,8 +265,7 @@ URLRequestPostInterceptor* URLRequestPostInterceptorFactory::CreateInterceptor(
bool res = io_task_runner_->PostTask(
FROM_HERE,
base::Bind(&URLRequestPostInterceptor::Delegate::OnCreateInterceptor,
- base::Unretained(delegate_),
- base::Unretained(interceptor)));
+ base::Unretained(delegate_), base::Unretained(interceptor)));
if (!res) {
delete interceptor;
return NULL;
@@ -303,4 +298,4 @@ URLRequestPostInterceptor* InterceptorFactory::CreateInterceptorForPath(
base::FilePath::FromUTF8Unsafe(url_path));
}
-} // namespace component_updater
+} // namespace update_client

Powered by Google App Engine
This is Rietveld 408576698