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/util/shell_util.h" | 5 #include "chrome/installer/util/shell_util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 ASSERT_TRUE(base::PathExists(shortcut_path)); | 809 ASSERT_TRUE(base::PathExists(shortcut_path)); |
810 ASSERT_TRUE(base::PathExists(shortcut_path.DirName())); | 810 ASSERT_TRUE(base::PathExists(shortcut_path.DirName())); |
811 } | 811 } |
812 | 812 |
813 class ShellUtilRegistryTest : public testing::Test { | 813 class ShellUtilRegistryTest : public testing::Test { |
814 public: | 814 public: |
815 ShellUtilRegistryTest() {} | 815 ShellUtilRegistryTest() {} |
816 | 816 |
817 protected: | 817 protected: |
818 void SetUp() override { | 818 void SetUp() override { |
819 registry_overrides_.OverrideRegistry(HKEY_CURRENT_USER); | 819 ASSERT_NO_FATAL_FAILURE( |
| 820 registry_overrides_.OverrideRegistry(HKEY_CURRENT_USER)); |
820 | 821 |
821 // .test2 files already have a default application. | 822 // .test2 files already have a default application. |
822 base::win::RegKey key; | 823 base::win::RegKey key; |
823 ASSERT_EQ( | 824 ASSERT_EQ( |
824 ERROR_SUCCESS, | 825 ERROR_SUCCESS, |
825 key.Create( | 826 key.Create( |
826 HKEY_CURRENT_USER, L"Software\\Classes\\.test2", KEY_ALL_ACCESS)); | 827 HKEY_CURRENT_USER, L"Software\\Classes\\.test2", KEY_ALL_ACCESS)); |
827 EXPECT_EQ(ERROR_SUCCESS, key.WriteValue(L"", L"SomeOtherApp")); | 828 EXPECT_EQ(ERROR_SUCCESS, key.WriteValue(L"", L"SomeOtherApp")); |
828 } | 829 } |
829 | 830 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
994 ASSERT_TRUE(ShellUtil::GetOldUserSpecificRegistrySuffix(&suffix)); | 995 ASSERT_TRUE(ShellUtil::GetOldUserSpecificRegistrySuffix(&suffix)); |
995 ASSERT_TRUE(base::StartsWith(suffix, L".", base::CompareCase::SENSITIVE)); | 996 ASSERT_TRUE(base::StartsWith(suffix, L".", base::CompareCase::SENSITIVE)); |
996 | 997 |
997 wchar_t user_name[256]; | 998 wchar_t user_name[256]; |
998 DWORD size = arraysize(user_name); | 999 DWORD size = arraysize(user_name); |
999 ASSERT_NE(0, ::GetUserName(user_name, &size)); | 1000 ASSERT_NE(0, ::GetUserName(user_name, &size)); |
1000 ASSERT_GE(size, 1U); | 1001 ASSERT_GE(size, 1U); |
1001 ASSERT_STREQ(user_name, suffix.substr(1).c_str()); | 1002 ASSERT_STREQ(user_name, suffix.substr(1).c_str()); |
1002 } | 1003 } |
1003 | 1004 |
OLD | NEW |