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 <windows.h> | 5 #include <windows.h> |
6 #include <atlsecurity.h> // NOLINT | 6 #include <atlsecurity.h> // NOLINT |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
9 #include "base/win/registry.h" | 12 #include "base/win/registry.h" |
10 #include "chrome/installer/util/delete_reg_key_work_item.h" | 13 #include "chrome/installer/util/delete_reg_key_work_item.h" |
11 #include "chrome/installer/util/registry_test_data.h" | 14 #include "chrome/installer/util/registry_test_data.h" |
12 #include "chrome/installer/util/work_item.h" | 15 #include "chrome/installer/util/work_item.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
14 | 17 |
15 using base::win::RegKey; | 18 using base::win::RegKey; |
16 | 19 |
17 class DeleteRegKeyWorkItemTest : public testing::Test { | 20 class DeleteRegKeyWorkItemTest : public testing::Test { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 EXPECT_EQ(1U, dw_value); | 133 EXPECT_EQ(1U, dw_value); |
131 // Give users all access to the subkey so it can be deleted. | 134 // Give users all access to the subkey so it can be deleted. |
132 EXPECT_EQ(ERROR_SUCCESS, | 135 EXPECT_EQ(ERROR_SUCCESS, |
133 RegSetKeySecurity(key.Handle(), DACL_SECURITY_INFORMATION, | 136 RegSetKeySecurity(key.Handle(), DACL_SECURITY_INFORMATION, |
134 const_cast<SECURITY_DESCRIPTOR*>( | 137 const_cast<SECURITY_DESCRIPTOR*>( |
135 sec_desc.GetPSECURITY_DESCRIPTOR()))); | 138 sec_desc.GetPSECURITY_DESCRIPTOR()))); |
136 EXPECT_EQ(ERROR_SUCCESS, key.OpenKey(L"Subkey2", KEY_QUERY_VALUE)); | 139 EXPECT_EQ(ERROR_SUCCESS, key.OpenKey(L"Subkey2", KEY_QUERY_VALUE)); |
137 EXPECT_EQ(ERROR_SUCCESS, key.ReadValueDW(L"", &dw_value)); | 140 EXPECT_EQ(ERROR_SUCCESS, key.ReadValueDW(L"", &dw_value)); |
138 EXPECT_EQ(2U, dw_value); | 141 EXPECT_EQ(2U, dw_value); |
139 } | 142 } |
OLD | NEW |