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

Side by Side Diff: chrome/browser/component_updater/test/component_patcher_unittest.h

Issue 25883006: Support asynchronous patching operations in the component updater. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: sorin@, cpu@ review Created 7 years 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 unified diff | Download patch
OLDNEW
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 "courgette/courgette.h" 12 #include "courgette/courgette.h"
13 #include "courgette/third_party/bsdiff.h" 13 #include "courgette/third_party/bsdiff.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 15
16 class ReadOnlyTestInstaller;
17
18 namespace component_updater {
19
16 class MockComponentPatcher; 20 class MockComponentPatcher;
17 class ReadOnlyTestInstaller;
18 21
19 const char binary_output_hash[] = 22 const char binary_output_hash[] =
20 "599aba6d15a7da390621ef1bacb66601ed6aed04dadc1f9b445dcfe31296142a"; 23 "599aba6d15a7da390621ef1bacb66601ed6aed04dadc1f9b445dcfe31296142a";
21 24
22 // These constants are duplicated from chrome/installer/util/util_constants.h, 25 // These constants are duplicated from chrome/installer/util/util_constants.h,
23 // to avoid introducing a dependency from the unit tests to the installer. 26 // to avoid introducing a dependency from the unit tests to the installer.
24 const int kCourgetteErrorOffset = 300; 27 const int kCourgetteErrorOffset = 300;
25 const int kBsdiffErrorOffset = 600; 28 const int kBsdiffErrorOffset = 600;
26 29
27 base::FilePath test_file(const char* file); 30 base::FilePath test_file(const char* file);
28 31
29 class ComponentPatcherOperationTest : public testing::Test { 32 class ComponentPatcherOperationTest : public testing::Test {
30 public: 33 public:
31 explicit ComponentPatcherOperationTest(); 34 explicit ComponentPatcherOperationTest();
32 virtual ~ComponentPatcherOperationTest(); 35 virtual ~ComponentPatcherOperationTest();
33 36
34 protected: 37 protected:
35 base::ScopedTempDir input_dir_; 38 base::ScopedTempDir input_dir_;
36 base::ScopedTempDir installed_dir_; 39 base::ScopedTempDir installed_dir_;
37 base::ScopedTempDir unpack_dir_; 40 base::ScopedTempDir unpack_dir_;
38 scoped_ptr<MockComponentPatcher> patcher_; 41 scoped_ptr<MockComponentPatcher> patcher_;
39 scoped_ptr<ReadOnlyTestInstaller> installer_; 42 scoped_ptr<ReadOnlyTestInstaller> installer_;
40 }; 43 };
41 44
45 } // namespace component_updater
46
42 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_ 47 #endif // CHROME_BROWSER_COMPONENT_UPDATER_TEST_COMPONENT_PATCHER_UNITTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698