OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/setup/setup_util_unittest.h" | 5 #include "chrome/installer/setup/setup_util_unittest.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 installer::ScopedTokenPrivilege dup_scoped_privilege(kTestedPrivilege); | 165 installer::ScopedTokenPrivilege dup_scoped_privilege(kTestedPrivilege); |
166 ASSERT_TRUE(dup_scoped_privilege.is_enabled()); | 166 ASSERT_TRUE(dup_scoped_privilege.is_enabled()); |
167 ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); | 167 ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); |
168 } | 168 } |
169 ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); | 169 ASSERT_TRUE(CurrentProcessHasPrivilege(kTestedPrivilege)); |
170 } | 170 } |
171 | 171 |
172 ASSERT_FALSE(CurrentProcessHasPrivilege(kTestedPrivilege)); | 172 ASSERT_FALSE(CurrentProcessHasPrivilege(kTestedPrivilege)); |
173 } | 173 } |
174 | 174 |
175 TEST(SetupUtilTest, GuidToSquid) { | |
176 ASSERT_EQ(installer::GuidToSquid(L"EDA620E3-AA98-3846-B81E-3493CB2E0E02"), | |
177 L"3E026ADE89AA64838BE14339BCE2E020"); | |
178 } | |
179 | |
180 const char kAdjustProcessPriority[] = "adjust-process-priority"; | 175 const char kAdjustProcessPriority[] = "adjust-process-priority"; |
181 | 176 |
182 PriorityClassChangeResult DoProcessPriorityAdjustment() { | 177 PriorityClassChangeResult DoProcessPriorityAdjustment() { |
183 return installer::AdjustProcessPriority() ? PCCR_CHANGED : PCCR_UNCHANGED; | 178 return installer::AdjustProcessPriority() ? PCCR_CHANGED : PCCR_UNCHANGED; |
184 } | 179 } |
185 | 180 |
186 namespace { | 181 namespace { |
187 | 182 |
188 // A scoper that sets/resets the current process's priority class. | 183 // A scoper that sets/resets the current process's priority class. |
189 class ScopedPriorityClass { | 184 class ScopedPriorityClass { |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 } | 624 } |
630 | 625 |
631 // Ensure that all values are absent. | 626 // Ensure that all values are absent. |
632 { | 627 { |
633 base::win::RegistryValueIterator it(root_, path_.c_str()); | 628 base::win::RegistryValueIterator it(root_, path_.c_str()); |
634 ASSERT_EQ(0, it.ValueCount()); | 629 ASSERT_EQ(0, it.ValueCount()); |
635 } | 630 } |
636 } | 631 } |
637 | 632 |
638 } // namespace installer | 633 } // namespace installer |
OLD | NEW |