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/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 .AppendASCII("update_client") | 62 .AppendASCII("update_client") |
63 .AppendASCII(file); | 63 .AppendASCII(file); |
64 } | 64 } |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 ComponentPatcherOperationTest::ComponentPatcherOperationTest() { | 68 ComponentPatcherOperationTest::ComponentPatcherOperationTest() { |
69 EXPECT_TRUE(unpack_dir_.CreateUniqueTempDir()); | 69 EXPECT_TRUE(unpack_dir_.CreateUniqueTempDir()); |
70 EXPECT_TRUE(input_dir_.CreateUniqueTempDir()); | 70 EXPECT_TRUE(input_dir_.CreateUniqueTempDir()); |
71 EXPECT_TRUE(installed_dir_.CreateUniqueTempDir()); | 71 EXPECT_TRUE(installed_dir_.CreateUniqueTempDir()); |
72 installer_.reset(new ReadOnlyTestInstaller(installed_dir_.path())); | 72 installer_ = new ReadOnlyTestInstaller(installed_dir_.path()); |
73 task_runner_ = base::MessageLoop::current()->task_runner(); | 73 task_runner_ = base::MessageLoop::current()->task_runner(); |
74 } | 74 } |
75 | 75 |
76 ComponentPatcherOperationTest::~ComponentPatcherOperationTest() { | 76 ComponentPatcherOperationTest::~ComponentPatcherOperationTest() { |
77 } | 77 } |
78 | 78 |
79 // Verify that a 'create' delta update operation works correctly. | 79 // Verify that a 'create' delta update operation works correctly. |
80 TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) { | 80 TEST_F(ComponentPatcherOperationTest, CheckCreateOperation) { |
81 EXPECT_TRUE(base::CopyFile( | 81 EXPECT_TRUE(base::CopyFile( |
82 test_file("binary_output.bin"), | 82 test_file("binary_output.bin"), |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 EXPECT_EQ(true, callback.called_); | 192 EXPECT_EQ(true, callback.called_); |
193 EXPECT_EQ(ComponentUnpacker::kNone, callback.error_); | 193 EXPECT_EQ(ComponentUnpacker::kNone, callback.error_); |
194 EXPECT_EQ(0, callback.extra_code_); | 194 EXPECT_EQ(0, callback.extra_code_); |
195 EXPECT_TRUE(base::ContentsEqual( | 195 EXPECT_TRUE(base::ContentsEqual( |
196 unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")), | 196 unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")), |
197 test_file("binary_output.bin"))); | 197 test_file("binary_output.bin"))); |
198 } | 198 } |
199 | 199 |
200 } // namespace update_client | 200 } // namespace update_client |
OLD | NEW |