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

Side by Side Diff: components/component_updater/test/url_request_post_interceptor.cc

Issue 493953002: Componentize component_updater: Move a bunch of tests to component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/files/file_util.h" 5 #include "components/component_updater/test/url_request_post_interceptor.h"
6
7 #include "base/file_util.h"
6 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
7 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/component_updater/test/url_request_post_interceptor.h" 10 #include "components/component_updater/test/test_configurator.h"
9 #include "content/public/test/test_browser_thread.h" 11 #include "content/public/test/test_browser_thread.h"
10 #include "net/base/upload_bytes_element_reader.h" 12 #include "net/base/upload_bytes_element_reader.h"
11 #include "net/url_request/url_request.h" 13 #include "net/url_request/url_request.h"
12 #include "net/url_request/url_request_filter.h" 14 #include "net/url_request/url_request_filter.h"
13 #include "net/url_request/url_request_interceptor.h" 15 #include "net/url_request/url_request_interceptor.h"
14 #include "net/url_request/url_request_simple_job.h" 16 #include "net/url_request/url_request_simple_job.h"
15 #include "net/url_request/url_request_test_util.h" 17 #include "net/url_request/url_request_test_util.h"
16 18
17 using content::BrowserThread; 19 using content::BrowserThread;
18 20
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 base::Unretained(delegate_), 251 base::Unretained(delegate_),
250 base::Unretained(interceptor))); 252 base::Unretained(interceptor)));
251 if (!res) { 253 if (!res) {
252 delete interceptor; 254 delete interceptor;
253 return NULL; 255 return NULL;
254 } 256 }
255 257
256 return interceptor; 258 return interceptor;
257 } 259 }
258 260
261 bool PartialMatch::Match(const std::string& actual) const {
262 return actual.find(expected_) != std::string::npos;
263 }
264
265 InterceptorFactory::InterceptorFactory()
266 : URLRequestPostInterceptorFactory(POST_INTERCEPT_SCHEME,
267 POST_INTERCEPT_HOSTNAME) {
268 }
269
270 InterceptorFactory::~InterceptorFactory() {
271 }
272
273 URLRequestPostInterceptor* InterceptorFactory::CreateInterceptor() {
274 return URLRequestPostInterceptorFactory::CreateInterceptor(
275 base::FilePath::FromUTF8Unsafe(POST_INTERCEPT_PATH));
276 }
277
259 } // namespace component_updater 278 } // namespace component_updater
OLDNEW
« no previous file with comments | « components/component_updater/test/url_request_post_interceptor.h ('k') | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698