| 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("EDA620E3-AA98-3846-B81E-3493CB2E0E02"), |
| 177 "3E026ADE89AA64838BE14339BCE2E020"); |
| 178 } |
| 179 |
| 175 const char kAdjustProcessPriority[] = "adjust-process-priority"; | 180 const char kAdjustProcessPriority[] = "adjust-process-priority"; |
| 176 | 181 |
| 177 PriorityClassChangeResult DoProcessPriorityAdjustment() { | 182 PriorityClassChangeResult DoProcessPriorityAdjustment() { |
| 178 return installer::AdjustProcessPriority() ? PCCR_CHANGED : PCCR_UNCHANGED; | 183 return installer::AdjustProcessPriority() ? PCCR_CHANGED : PCCR_UNCHANGED; |
| 179 } | 184 } |
| 180 | 185 |
| 181 namespace { | 186 namespace { |
| 182 | 187 |
| 183 // A scoper that sets/resets the current process's priority class. | 188 // A scoper that sets/resets the current process's priority class. |
| 184 class ScopedPriorityClass { | 189 class ScopedPriorityClass { |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 } | 629 } |
| 625 | 630 |
| 626 // Ensure that all values are absent. | 631 // Ensure that all values are absent. |
| 627 { | 632 { |
| 628 base::win::RegistryValueIterator it(root_, path_.c_str()); | 633 base::win::RegistryValueIterator it(root_, path_.c_str()); |
| 629 ASSERT_EQ(0, it.ValueCount()); | 634 ASSERT_EQ(0, it.ValueCount()); |
| 630 } | 635 } |
| 631 } | 636 } |
| 632 | 637 |
| 633 } // namespace installer | 638 } // namespace installer |
| OLD | NEW |