Refactor use of indexed accessors in profile_info_cache.cc
The use of indexed accessors, other than those in the indexed accessors
themselves, are refactored to use ProfileAttributesStorage and
ProfileAttributesEntry.
This make future migration of the implementations of the indexed
accessors easier.
Bug: 305720
Change-Id: I7a9c40abbc2e9fec97a33c260718e083c0a0a485
Reviewed-on: https://chromium-review.googlesource.com/643446
Commit-Queue: WC Leung <[email protected]>
Reviewed-by: anthonyvd OoO until september 24th <[email protected]>
Cr-Commit-Position: refs/heads/master@{#499370}
diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc
index 5554b5ee..873f4ad 100644
--- a/chrome/browser/profiles/profile_info_cache_unittest.cc
+++ b/chrome/browser/profiles/profile_info_cache_unittest.cc
@@ -744,11 +744,22 @@
ResetCache();
// Legacy profile names like "Default Profile" and "First user" should be
- // migrated to "Person %n" type names.
- EXPECT_EQ(ASCIIToUTF16("Person 1"), GetCache()->GetNameOfProfileAtIndex(
- GetCache()->GetIndexOfProfileWithPath(path_1)));
- EXPECT_EQ(ASCIIToUTF16("Person 3"), GetCache()->GetNameOfProfileAtIndex(
- GetCache()->GetIndexOfProfileWithPath(path_2)));
+ // migrated to "Person %n" type names, i.e. any permutation of "Person 1" and
+ // "Person 3".
+ if (ASCIIToUTF16("Person 1") ==
+ GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(path_1))) {
+ EXPECT_EQ(ASCIIToUTF16("Person 3"),
+ GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(path_2)));
+ } else {
+ EXPECT_EQ(ASCIIToUTF16("Person 3"),
+ GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(path_1)));
+ EXPECT_EQ(ASCIIToUTF16("Person 1"),
+ GetCache()->GetNameOfProfileAtIndex(
+ GetCache()->GetIndexOfProfileWithPath(path_2)));
+ }
// Other profile names should not be migrated even if they're the old
// default cartoon profile names.