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

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: Put test data file move in separate CLs. 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
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 775e898c2ea906f44e23c05dfb9ad8a24d5ebc9a..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 "chrome/browser/component_updater/test/url_request_post_interceptor.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 "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

Powered by Google App Engine
This is Rietveld 408576698