OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <windows.h> | 5 #include <windows.h> |
6 #include <shlwapi.h> // For SHDeleteKey. | 6 #include <shlwapi.h> // For SHDeleteKey. |
7 | 7 |
8 #include "base/registry.h" | |
9 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/win/registry.h" |
10 #include "chrome/installer/util/browser_distribution.h" | 10 #include "chrome/installer/util/browser_distribution.h" |
11 #include "chrome/installer/util/google_update_constants.h" | 11 #include "chrome/installer/util/google_update_constants.h" |
12 #include "chrome/installer/util/google_update_settings.h" | 12 #include "chrome/installer/util/google_update_settings.h" |
13 #include "chrome/installer/util/work_item_list.h" | 13 #include "chrome/installer/util/work_item_list.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
| 16 using base::win::RegKey; |
| 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 const wchar_t kHKCUReplacement[] = | 20 const wchar_t kHKCUReplacement[] = |
19 L"Software\\Google\\InstallUtilUnittest\\HKCU"; | 21 L"Software\\Google\\InstallUtilUnittest\\HKCU"; |
20 const wchar_t kHKLMReplacement[] = | 22 const wchar_t kHKLMReplacement[] = |
21 L"Software\\Google\\InstallUtilUnittest\\HKLM"; | 23 L"Software\\Google\\InstallUtilUnittest\\HKLM"; |
22 | 24 |
23 const wchar_t kTestProductGuid[] = L"{89F1B351-B15D-48D4-8F10-1298721CF13D}"; | 25 const wchar_t kTestProductGuid[] = L"{89F1B351-B15D-48D4-8F10-1298721CF13D}"; |
24 | 26 |
25 // This test fixture redirects the HKLM and HKCU registry hives for | 27 // This test fixture redirects the HKLM and HKCU registry hives for |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 // - Finally restore the original value of ap key. | 345 // - Finally restore the original value of ap key. |
344 key.Open(HKEY_CURRENT_USER, reg_key.c_str(), KEY_ALL_ACCESS); | 346 key.Open(HKEY_CURRENT_USER, reg_key.c_str(), KEY_ALL_ACCESS); |
345 key.DeleteValue(google_update::kRegApField); | 347 key.DeleteValue(google_update::kRegApField); |
346 work_item_list->Rollback(); | 348 work_item_list->Rollback(); |
347 if (ap_key_deleted) { | 349 if (ap_key_deleted) { |
348 work_item_list.reset(WorkItem::CreateWorkItemList()); | 350 work_item_list.reset(WorkItem::CreateWorkItemList()); |
349 ASSERT_TRUE(CreateApKey(work_item_list.get(), ap_key_value)) | 351 ASSERT_TRUE(CreateApKey(work_item_list.get(), ap_key_value)) |
350 << "Failed to restore ap key."; | 352 << "Failed to restore ap key."; |
351 } | 353 } |
352 } | 354 } |
OLD | NEW |