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

Unified 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, 4 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
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/component_updater/test/url_request_post_interceptor.cc
diff --git a/chrome/browser/component_updater/test/url_request_post_interceptor.cc b/components/component_updater/test/url_request_post_interceptor.cc
similarity index 92%
rename from chrome/browser/component_updater/test/url_request_post_interceptor.cc
rename to components/component_updater/test/url_request_post_interceptor.cc
index e2f60f384a99cf1e9ec21b31175558696240d1a3..eae42b4660d6f226440544c8983370583c952918 100644
--- a/chrome/browser/component_updater/test/url_request_post_interceptor.cc
+++ b/components/component_updater/test/url_request_post_interceptor.cc
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/files/file_util.h"
+#include "components/component_updater/test/url_request_post_interceptor.h"
+
+#include "base/file_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/stringprintf.h"
-#include "chrome/browser/component_updater/test/url_request_post_interceptor.h"
+#include "components/component_updater/test/test_configurator.h"
#include "content/public/test/test_browser_thread.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/url_request/url_request.h"
@@ -256,4 +258,21 @@ URLRequestPostInterceptor* URLRequestPostInterceptorFactory::CreateInterceptor(
return interceptor;
}
+bool PartialMatch::Match(const std::string& actual) const {
+ return actual.find(expected_) != std::string::npos;
+}
+
+InterceptorFactory::InterceptorFactory()
+ : URLRequestPostInterceptorFactory(POST_INTERCEPT_SCHEME,
+ POST_INTERCEPT_HOSTNAME) {
+}
+
+InterceptorFactory::~InterceptorFactory() {
+}
+
+URLRequestPostInterceptor* InterceptorFactory::CreateInterceptor() {
+ return URLRequestPostInterceptorFactory::CreateInterceptor(
+ base::FilePath::FromUTF8Unsafe(POST_INTERCEPT_PATH));
+}
+
} // namespace component_updater
« 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