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

Unified Diff: chrome/browser/component_updater/test/component_updater_service_unittest.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
Index: chrome/browser/component_updater/test/component_updater_service_unittest.cc
diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.cc b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
index c01d72f1a10efe3a024f4ecb187a0799c1f3a5d2..ab70d8bd709dc2234683347af441bb58fe121b05 100644
--- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc
+++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc
@@ -14,10 +14,10 @@
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/component_updater/component_updater_resource_throttle.h"
-#include "chrome/browser/component_updater/test/test_configurator.h"
-#include "chrome/browser/component_updater/test/test_installer.h"
#include "chrome/common/chrome_paths.h"
#include "components/component_updater/component_updater_utils.h"
+#include "components/component_updater/test/test_configurator.h"
+#include "components/component_updater/test/test_installer.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_controller.h"
#include "content/public/browser/resource_request_info.h"
@@ -43,23 +43,6 @@ MockServiceObserver::MockServiceObserver() {
MockServiceObserver::~MockServiceObserver() {
}
-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));
-}
-
ComponentUpdaterTest::ComponentUpdaterTest()
: test_config_(NULL),
thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
@@ -67,10 +50,6 @@ ComponentUpdaterTest::ComponentUpdaterTest()
test_config_ = new TestConfigurator;
component_updater_.reset(ComponentUpdateServiceFactory(test_config_));
- // The test directory is chrome/test/data/components.
- PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_);
- test_data_dir_ = test_data_dir_.AppendASCII("components");
-
net::URLFetcher::SetEnableInterceptionForTests(true);
}
@@ -97,7 +76,10 @@ ComponentUpdateService* ComponentUpdaterTest::component_updater() {
// Makes the full path to a component updater test file.
const base::FilePath ComponentUpdaterTest::test_file(const char* file) {
- return test_data_dir_.AppendASCII(file);
+ base::FilePath path;
+ PathService::Get(base::DIR_SOURCE_ROOT, &path);
+ return path.AppendASCII("components").AppendASCII("test").AppendASCII("data")
+ .AppendASCII("component_updater").AppendASCII(file);
}
TestConfigurator* ComponentUpdaterTest::test_configurator() {

Powered by Google App Engine
This is Rietveld 408576698