| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 int error = 0; | 39 int error = 0; |
| 40 scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpPatchCourgette()); | 40 scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpPatchCourgette()); |
| 41 ComponentUnpacker::Error result = op->Run(command_args.get(), | 41 ComponentUnpacker::Error result = op->Run(command_args.get(), |
| 42 input_dir_.path(), | 42 input_dir_.path(), |
| 43 unpack_dir_.path(), | 43 unpack_dir_.path(), |
| 44 patcher_.get(), | 44 patcher_.get(), |
| 45 installer_.get(), | 45 installer_.get(), |
| 46 &error); | 46 &error); |
| 47 EXPECT_EQ(ComponentUnpacker::kNone, result); | 47 EXPECT_EQ(ComponentUnpacker::kNone, result); |
| 48 EXPECT_EQ(0, error); | 48 EXPECT_EQ(0, error); |
| 49 EXPECT_TRUE(file_util::ContentsEqual( | 49 EXPECT_TRUE(base::ContentsEqual( |
| 50 unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")), | 50 unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")), |
| 51 test_file("binary_output.bin"))); | 51 test_file("binary_output.bin"))); |
| 52 } | 52 } |
| 53 | 53 |
| 54 // Verify that a 'bsdiff' delta update operation works correctly. | 54 // Verify that a 'bsdiff' delta update operation works correctly. |
| 55 TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) { | 55 TEST_F(ComponentPatcherOperationTest, CheckBsdiffOperation) { |
| 56 EXPECT_TRUE(base::CopyFile( | 56 EXPECT_TRUE(base::CopyFile( |
| 57 test_file("binary_input.bin"), | 57 test_file("binary_input.bin"), |
| 58 installed_dir_.path().Append(FILE_PATH_LITERAL("binary_input.bin")))); | 58 installed_dir_.path().Append(FILE_PATH_LITERAL("binary_input.bin")))); |
| 59 EXPECT_TRUE(base::CopyFile( | 59 EXPECT_TRUE(base::CopyFile( |
| (...skipping 10 matching lines...) Expand all Loading... |
| 70 int error = 0; | 70 int error = 0; |
| 71 scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpPatchBsdiff()); | 71 scoped_ptr<DeltaUpdateOp> op(new DeltaUpdateOpPatchBsdiff()); |
| 72 ComponentUnpacker::Error result = op->Run(command_args.get(), | 72 ComponentUnpacker::Error result = op->Run(command_args.get(), |
| 73 input_dir_.path(), | 73 input_dir_.path(), |
| 74 unpack_dir_.path(), | 74 unpack_dir_.path(), |
| 75 patcher_.get(), | 75 patcher_.get(), |
| 76 installer_.get(), | 76 installer_.get(), |
| 77 &error); | 77 &error); |
| 78 EXPECT_EQ(ComponentUnpacker::kNone, result); | 78 EXPECT_EQ(ComponentUnpacker::kNone, result); |
| 79 EXPECT_EQ(0, error); | 79 EXPECT_EQ(0, error); |
| 80 EXPECT_TRUE(file_util::ContentsEqual( | 80 EXPECT_TRUE(base::ContentsEqual( |
| 81 unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")), | 81 unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")), |
| 82 test_file("binary_output.bin"))); | 82 test_file("binary_output.bin"))); |
| 83 } | 83 } |
| OLD | NEW |