| Index: components/update_client/test/component_patcher_unittest.cc
|
| diff --git a/components/component_updater/test/component_patcher_unittest.cc b/components/update_client/test/component_patcher_unittest.cc
|
| similarity index 85%
|
| rename from components/component_updater/test/component_patcher_unittest.cc
|
| rename to components/update_client/test/component_patcher_unittest.cc
|
| index 2b980bd1b4647c1b200416f373a6510cb3d9fed7..ce6e7a1306a44da61ebaebb41cf1ef683d585261 100644
|
| --- a/components/component_updater/test/component_patcher_unittest.cc
|
| +++ b/components/update_client/test/component_patcher_unittest.cc
|
| @@ -13,11 +13,10 @@
|
| #include "base/path_service.h"
|
| #include "base/run_loop.h"
|
| #include "base/values.h"
|
| -#include "components/component_updater/component_patcher.h"
|
| -#include "components/component_updater/component_patcher_operation.h"
|
| -#include "components/component_updater/component_updater_service.h"
|
| -#include "components/component_updater/test/component_patcher_unittest.h"
|
| -#include "components/component_updater/test/test_installer.h"
|
| +#include "components/update_client/component_patcher.h"
|
| +#include "components/update_client/component_patcher_operation.h"
|
| +#include "components/update_client/test/component_patcher_unittest.h"
|
| +#include "components/update_client/test/test_installer.h"
|
| #include "courgette/courgette.h"
|
| #include "courgette/third_party/bsdiff.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -28,7 +27,7 @@ class TestCallback {
|
| public:
|
| TestCallback();
|
| virtual ~TestCallback() {}
|
| - void Set(component_updater::ComponentUnpacker::Error error, int extra_code);
|
| + void Set(update_client::ComponentUnpacker::Error error, int extra_code);
|
|
|
| int error_;
|
| int extra_code_;
|
| @@ -41,7 +40,7 @@ class TestCallback {
|
| TestCallback::TestCallback() : error_(-1), extra_code_(-1), called_(false) {
|
| }
|
|
|
| -void TestCallback::Set(component_updater::ComponentUnpacker::Error error,
|
| +void TestCallback::Set(update_client::ComponentUnpacker::Error error,
|
| int extra_code) {
|
| error_ = error;
|
| extra_code_ = extra_code;
|
| @@ -50,15 +49,18 @@ void TestCallback::Set(component_updater::ComponentUnpacker::Error error,
|
|
|
| } // namespace
|
|
|
| -namespace component_updater {
|
| +namespace update_client {
|
|
|
| namespace {
|
|
|
| base::FilePath test_file(const char* file) {
|
| base::FilePath path;
|
| PathService::Get(base::DIR_SOURCE_ROOT, &path);
|
| - return path.AppendASCII("components").AppendASCII("test").AppendASCII("data")
|
| - .AppendASCII("component_updater").AppendASCII(file);
|
| + return path.AppendASCII("components")
|
| + .AppendASCII("test")
|
| + .AppendASCII("data")
|
| + .AppendASCII("update_client")
|
| + .AppendASCII(file);
|
| }
|
|
|
| } // namespace
|
| @@ -88,10 +90,7 @@ TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) {
|
|
|
| TestCallback callback;
|
| scoped_refptr<DeltaUpdateOp> op = new DeltaUpdateOpCreate();
|
| - op->Run(command_args.get(),
|
| - input_dir_.path(),
|
| - unpack_dir_.path(),
|
| - NULL,
|
| + op->Run(command_args.get(), input_dir_.path(), unpack_dir_.path(), NULL,
|
| base::Bind(&TestCallback::Set, base::Unretained(&callback)),
|
| task_runner_);
|
| base::RunLoop().RunUntilIdle();
|
| @@ -118,9 +117,7 @@ TEST_F(ComponentPatcherOperationTest, CheckCopyOperation) {
|
|
|
| TestCallback callback;
|
| scoped_refptr<DeltaUpdateOp> op = new DeltaUpdateOpCopy();
|
| - op->Run(command_args.get(),
|
| - input_dir_.path(),
|
| - unpack_dir_.path(),
|
| + op->Run(command_args.get(), input_dir_.path(), unpack_dir_.path(),
|
| installer_.get(),
|
| base::Bind(&TestCallback::Set, base::Unretained(&callback)),
|
| task_runner_);
|
| @@ -153,9 +150,7 @@ TEST_F(ComponentPatcherOperationTest, CheckCourgetteOperation) {
|
| TestCallback callback;
|
| scoped_refptr<DeltaUpdateOp> op =
|
| CreateDeltaUpdateOp("courgette", NULL /* out_of_process_patcher */);
|
| - op->Run(command_args.get(),
|
| - input_dir_.path(),
|
| - unpack_dir_.path(),
|
| + op->Run(command_args.get(), input_dir_.path(), unpack_dir_.path(),
|
| installer_.get(),
|
| base::Bind(&TestCallback::Set, base::Unretained(&callback)),
|
| task_runner_);
|
| @@ -188,9 +183,7 @@ TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) {
|
| TestCallback callback;
|
| scoped_refptr<DeltaUpdateOp> op =
|
| CreateDeltaUpdateOp("bsdiff", NULL /* out_of_process_patcher */);
|
| - op->Run(command_args.get(),
|
| - input_dir_.path(),
|
| - unpack_dir_.path(),
|
| + op->Run(command_args.get(), input_dir_.path(), unpack_dir_.path(),
|
| installer_.get(),
|
| base::Bind(&TestCallback::Set, base::Unretained(&callback)),
|
| task_runner_);
|
| @@ -204,4 +197,4 @@ TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) {
|
| test_file("binary_output.bin")));
|
| }
|
|
|
| -} // namespace component_updater
|
| +} // namespace update_client
|
|
|