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/browser/profiles/profile_info_cache_unittest.h" | 5 #include "chrome/browser/profiles/profile_info_cache_unittest.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 GetCache()->GetIndexOfProfileWithPath(path_3))); | 632 GetCache()->GetIndexOfProfileWithPath(path_3))); |
633 EXPECT_EQ(name_4, GetCache()->GetNameOfProfileAtIndex( | 633 EXPECT_EQ(name_4, GetCache()->GetNameOfProfileAtIndex( |
634 GetCache()->GetIndexOfProfileWithPath(path_4))); | 634 GetCache()->GetIndexOfProfileWithPath(path_4))); |
635 EXPECT_EQ(name_5, GetCache()->GetNameOfProfileAtIndex( | 635 EXPECT_EQ(name_5, GetCache()->GetNameOfProfileAtIndex( |
636 GetCache()->GetIndexOfProfileWithPath(path_5))); | 636 GetCache()->GetIndexOfProfileWithPath(path_5))); |
637 } | 637 } |
638 #endif | 638 #endif |
639 | 639 |
640 TEST_F(ProfileInfoCacheTest, | 640 TEST_F(ProfileInfoCacheTest, |
641 DontMigrateLegacyProfileNamesWithoutNewAvatarMenu) { | 641 DontMigrateLegacyProfileNamesWithoutNewAvatarMenu) { |
| 642 switches::DisableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess()); |
| 643 |
642 EXPECT_EQ(0U, GetCache()->GetNumberOfProfiles()); | 644 EXPECT_EQ(0U, GetCache()->GetNumberOfProfiles()); |
643 | 645 |
644 base::string16 name_1 = ASCIIToUTF16("Default Profile"); | 646 base::string16 name_1 = ASCIIToUTF16("Default Profile"); |
645 base::FilePath path_1 = GetProfilePath("path_1"); | 647 base::FilePath path_1 = GetProfilePath("path_1"); |
646 GetCache()->AddProfileToCache(path_1, name_1, | 648 GetCache()->AddProfileToCache(path_1, name_1, |
647 base::string16(), 0, std::string()); | 649 base::string16(), 0, std::string()); |
648 base::string16 name_2 = ASCIIToUTF16("First user"); | 650 base::string16 name_2 = ASCIIToUTF16("First user"); |
649 base::FilePath path_2 = GetProfilePath("path_2"); | 651 base::FilePath path_2 = GetProfilePath("path_2"); |
650 GetCache()->AddProfileToCache(path_2, name_2, | 652 GetCache()->AddProfileToCache(path_2, name_2, |
651 base::string16(), 1, std::string()); | 653 base::string16(), 1, std::string()); |
(...skipping 13 matching lines...) Expand all Loading... |
665 EXPECT_EQ(name_1, GetCache()->GetNameOfProfileAtIndex( | 667 EXPECT_EQ(name_1, GetCache()->GetNameOfProfileAtIndex( |
666 GetCache()->GetIndexOfProfileWithPath(path_1))); | 668 GetCache()->GetIndexOfProfileWithPath(path_1))); |
667 EXPECT_EQ(name_2, GetCache()->GetNameOfProfileAtIndex( | 669 EXPECT_EQ(name_2, GetCache()->GetNameOfProfileAtIndex( |
668 GetCache()->GetIndexOfProfileWithPath(path_2))); | 670 GetCache()->GetIndexOfProfileWithPath(path_2))); |
669 EXPECT_EQ(name_3, GetCache()->GetNameOfProfileAtIndex( | 671 EXPECT_EQ(name_3, GetCache()->GetNameOfProfileAtIndex( |
670 GetCache()->GetIndexOfProfileWithPath(path_3))); | 672 GetCache()->GetIndexOfProfileWithPath(path_3))); |
671 EXPECT_EQ(name_4, GetCache()->GetNameOfProfileAtIndex( | 673 EXPECT_EQ(name_4, GetCache()->GetNameOfProfileAtIndex( |
672 GetCache()->GetIndexOfProfileWithPath(path_4))); | 674 GetCache()->GetIndexOfProfileWithPath(path_4))); |
673 } | 675 } |
674 | 676 |
OLD | NEW |