| 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 #include "chrome/installer/util/registry_key_backup.h" |
| 6 |
| 5 #include <windows.h> | 7 #include <windows.h> |
| 6 | 8 |
| 9 #include <memory> |
| 10 |
| 7 #include "base/logging.h" | 11 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "base/win/registry.h" | 12 #include "base/win/registry.h" |
| 10 #include "chrome/installer/util/registry_key_backup.h" | |
| 11 #include "chrome/installer/util/registry_test_data.h" | 13 #include "chrome/installer/util/registry_test_data.h" |
| 12 #include "chrome/installer/util/work_item.h" | 14 #include "chrome/installer/util/work_item.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 16 |
| 15 using base::win::RegKey; | 17 using base::win::RegKey; |
| 16 | 18 |
| 17 class RegistryKeyBackupTest : public testing::Test { | 19 class RegistryKeyBackupTest : public testing::Test { |
| 18 protected: | 20 protected: |
| 19 static void TearDownTestCase() { | 21 static void TearDownTestCase() { |
| 20 logging::CloseLogFile(); | 22 logging::CloseLogFile(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Now make sure the one we started with is truly empty. | 89 // Now make sure the one we started with is truly empty. |
| 88 EXPECT_EQ(ERROR_SUCCESS, | 90 EXPECT_EQ(ERROR_SUCCESS, |
| 89 RegKey(test_data_.root_key(), L"", KEY_QUERY_VALUE) | 91 RegKey(test_data_.root_key(), L"", KEY_QUERY_VALUE) |
| 90 .DeleteKey(destination_path_.c_str())); | 92 .DeleteKey(destination_path_.c_str())); |
| 91 EXPECT_TRUE(backup.WriteTo(test_data_.root_key(), | 93 EXPECT_TRUE(backup.WriteTo(test_data_.root_key(), |
| 92 destination_path_.c_str(), | 94 destination_path_.c_str(), |
| 93 WorkItem::kWow64Default)); | 95 WorkItem::kWow64Default)); |
| 94 EXPECT_FALSE(RegKey(test_data_.root_key(), destination_path_.c_str(), | 96 EXPECT_FALSE(RegKey(test_data_.root_key(), destination_path_.c_str(), |
| 95 KEY_READ).Valid()); | 97 KEY_READ).Valid()); |
| 96 } | 98 } |
| OLD | NEW |