OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INSTALLER_UTIL_PRODUCT_UNITTEST_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_PRODUCT_UNITTEST_H_ |
6 #define CHROME_INSTALLER_UTIL_PRODUCT_UNITTEST_H_ | 6 #define CHROME_INSTALLER_UTIL_PRODUCT_UNITTEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/scoped_temp_dir.h" | 14 #include "base/scoped_temp_dir.h" |
15 #include "base/win/registry.h" | |
16 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
17 | 16 |
18 class TestWithTempDir : public testing::Test { | 17 class TestWithTempDir : public testing::Test { |
19 protected: | 18 protected: |
20 virtual void SetUp(); | 19 virtual void SetUp(); |
21 virtual void TearDown(); | 20 virtual void TearDown(); |
22 | 21 |
23 ScopedTempDir test_dir_; | 22 ScopedTempDir test_dir_; |
24 }; | 23 }; |
25 | 24 |
26 class TestWithTempDirAndDeleteTempOverrideKeys : public TestWithTempDir { | 25 class TestWithTempDirAndDeleteTempOverrideKeys : public TestWithTempDir { |
27 protected: | 26 protected: |
28 virtual void SetUp(); | 27 virtual void SetUp(); |
29 virtual void TearDown(); | 28 virtual void TearDown(); |
30 }; | 29 }; |
31 | 30 |
32 // TODO(tommi): This is "borrowed" from Chrome Frame test code. It should be | |
33 // moved to some common test utility file. | |
tommi (sloooow) - chröme
2011/08/23 20:33:24
w00t!
Roger Tawa OOO till Jul 10th
2011/08/23 21:08:02
Done.
| |
34 class TempRegKeyOverride { | |
35 public: | |
36 static const wchar_t kTempTestKeyPath[]; | |
37 | |
38 TempRegKeyOverride(HKEY override, const wchar_t* temp_name); | |
39 ~TempRegKeyOverride(); | |
40 | |
41 static void DeleteAllTempKeys(); | |
42 | |
43 protected: | |
44 HKEY override_; | |
45 base::win::RegKey temp_key_; | |
46 std::wstring temp_name_; | |
47 }; | |
48 | |
49 #endif // CHROME_INSTALLER_UTIL_PRODUCT_UNITTEST_H_ | 31 #endif // CHROME_INSTALLER_UTIL_PRODUCT_UNITTEST_H_ |
OLD | NEW |