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 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "content/public/test/test_browser_thread_bundle.h" | |
13 #include "courgette/courgette.h" | 12 #include "courgette/courgette.h" |
14 #include "courgette/third_party/bsdiff.h" | 13 #include "courgette/third_party/bsdiff.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
16 | 15 |
17 namespace component_updater { | 16 namespace component_updater { |
18 | 17 |
19 class MockComponentPatcher; | 18 class MockComponentPatcher; |
20 class ReadOnlyTestInstaller; | 19 class ReadOnlyTestInstaller; |
21 | 20 |
22 const char binary_output_hash[] = | 21 const char binary_output_hash[] = |
23 "599aba6d15a7da390621ef1bacb66601ed6aed04dadc1f9b445dcfe31296142a"; | 22 "599aba6d15a7da390621ef1bacb66601ed6aed04dadc1f9b445dcfe31296142a"; |
24 | 23 |
25 // These constants are duplicated from chrome/installer/util/util_constants.h, | 24 // These constants are duplicated from chrome/installer/util/util_constants.h, |
26 // to avoid introducing a dependency from the unit tests to the installer. | 25 // to avoid introducing a dependency from the unit tests to the installer. |
27 const int kCourgetteErrorOffset = 300; | 26 const int kCourgetteErrorOffset = 300; |
28 const int kBsdiffErrorOffset = 600; | 27 const int kBsdiffErrorOffset = 600; |
29 | 28 |
30 class ComponentPatcherOperationTest : public testing::Test { | 29 class ComponentPatcherOperationTest : public testing::Test { |
31 public: | 30 public: |
32 explicit ComponentPatcherOperationTest(); | 31 explicit ComponentPatcherOperationTest(); |
33 virtual ~ComponentPatcherOperationTest(); | 32 virtual ~ComponentPatcherOperationTest(); |
34 | 33 |
35 protected: | 34 protected: |
36 base::ScopedTempDir input_dir_; | 35 base::ScopedTempDir input_dir_; |
37 base::ScopedTempDir installed_dir_; | 36 base::ScopedTempDir installed_dir_; |
38 base::ScopedTempDir unpack_dir_; | 37 base::ScopedTempDir unpack_dir_; |
| 38 scoped_ptr<MockComponentPatcher> patcher_; |
39 scoped_ptr<ReadOnlyTestInstaller> installer_; | 39 scoped_ptr<ReadOnlyTestInstaller> installer_; |
40 scoped_refptr<base::SequencedTaskRunner> task_runner_; | |
41 | |
42 private: | |
43 content::TestBrowserThreadBundle thread_bundle_; | |
44 }; | 40 }; |
45 | 41 |
46 } // namespace component_updater | 42 } // namespace component_updater |
47 | 43 |
48 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ | 44 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ |
OLD | NEW |