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

Unified Diff: chrome/browser/component_updater/test/component_patcher_unittest.cc

Issue 25883006: Support asynchronous patching operations in the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: New LKGR, Windows fixes. Created 7 years, 2 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_patcher_unittest.cc
diff --git a/chrome/browser/component_updater/test/component_patcher_unittest.cc b/chrome/browser/component_updater/test/component_patcher_unittest.cc
index 67256f9e36b6925ce39530a2794562114887aa21..0ad456fd4cb2abcf253b558002ca537834477be5 100644
--- a/chrome/browser/component_updater/test/component_patcher_unittest.cc
+++ b/chrome/browser/component_updater/test/component_patcher_unittest.cc
@@ -36,7 +36,7 @@ ComponentPatcherOperationTest::ComponentPatcherOperationTest() {
ComponentPatcherOperationTest::~ComponentPatcherOperationTest() {
}
-ComponentUnpacker::Error MockComponentPatcher::Patch(
+component_updater::Error MockComponentPatcher::Patch(
PatchType patch_type,
const base::FilePath& input_file,
const base::FilePath& patch_file,
@@ -49,17 +49,17 @@ ComponentUnpacker::Error MockComponentPatcher::Patch(
patch_file.value().c_str(),
output_file.value().c_str());
if (exit_code == courgette::C_OK)
- return ComponentUnpacker::kNone;
+ return component_updater::kNone;
*error = exit_code + kCourgetteErrorOffset;
} else if (patch_type == kPatchTypeBsdiff) {
exit_code = courgette::ApplyBinaryPatch(input_file,
patch_file,
output_file);
if (exit_code == courgette::OK)
- return ComponentUnpacker::kNone;
+ return component_updater::kNone;
*error = exit_code + kBsdiffErrorOffset;
}
- return ComponentUnpacker::kDeltaOperationFailure;
+ return component_updater::kDeltaOperationFailure;
}
// Verify that a 'create' delta update operation works correctly.
@@ -76,14 +76,14 @@ TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) {
int error = 0;
scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpCreate());
- ComponentUnpacker::Error result = op->Run(command_args.get(),
+ component_updater::Error result = op->Run(command_args.get(),
input_dir_.path(),
unpack_dir_.path(),
patcher_.get(),
NULL,
&error);
- EXPECT_EQ(ComponentUnpacker::kNone, result);
+ EXPECT_EQ(component_updater::kNone, result);
EXPECT_EQ(0, error);
EXPECT_TRUE(base::ContentsEqual(
unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
@@ -104,13 +104,13 @@ TEST_F(ComponentPatcherOperationTest, CheckCopyOperation) {
int error = 0;
scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpCopy());
- ComponentUnpacker::Error result = op->Run(command_args.get(),
+ component_updater::Error result = op->Run(command_args.get(),
input_dir_.path(),
unpack_dir_.path(),
patcher_.get(),
installer_.get(),
&error);
- EXPECT_EQ(ComponentUnpacker::kNone, result);
+ EXPECT_EQ(component_updater::kNone, result);
EXPECT_EQ(0, error);
EXPECT_TRUE(base::ContentsEqual(
unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
@@ -136,13 +136,13 @@ TEST_F(ComponentPatcherOperationTest, CheckCourgetteOperation) {
int error = 0;
scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpPatchCourgette());
- ComponentUnpacker::Error result = op->Run(command_args.get(),
+ component_updater::Error result = op->Run(command_args.get(),
input_dir_.path(),
unpack_dir_.path(),
patcher_.get(),
installer_.get(),
&error);
- EXPECT_EQ(ComponentUnpacker::kNone, result);
+ EXPECT_EQ(component_updater::kNone, result);
EXPECT_EQ(0, error);
EXPECT_TRUE(base::ContentsEqual(
unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
@@ -167,13 +167,13 @@ TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) {
int error = 0;
scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpPatchBsdiff());
- ComponentUnpacker::Error result = op->Run(command_args.get(),
+ component_updater::Error result = op->Run(command_args.get(),
input_dir_.path(),
unpack_dir_.path(),
patcher_.get(),
installer_.get(),
&error);
- EXPECT_EQ(ComponentUnpacker::kNone, result);
+ EXPECT_EQ(component_updater::kNone, result);
EXPECT_EQ(0, error);
EXPECT_TRUE(base::ContentsEqual(
unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),

Powered by Google App Engine
This is Rietveld 408576698