OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <unordered_set> | 7 #include <unordered_set> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 GetProfilePath("testing_profile_path0"), &entry)); | 204 GetProfilePath("testing_profile_path0"), &entry)); |
205 EXPECT_EQ(base::ASCIIToUTF16("testing_profile_name0"), entry->GetName()); | 205 EXPECT_EQ(base::ASCIIToUTF16("testing_profile_name0"), entry->GetName()); |
206 | 206 |
207 storage()->RemoveProfile(GetProfilePath("testing_profile_path0")); | 207 storage()->RemoveProfile(GetProfilePath("testing_profile_path0")); |
208 ASSERT_FALSE(storage()->GetProfileAttributesWithPath( | 208 ASSERT_FALSE(storage()->GetProfileAttributesWithPath( |
209 GetProfilePath("testing_profile_path0"), &entry)); | 209 GetProfilePath("testing_profile_path0"), &entry)); |
210 EXPECT_EQ(4U, storage()->GetNumberOfProfiles()); | 210 EXPECT_EQ(4U, storage()->GetNumberOfProfiles()); |
211 | 211 |
212 std::vector<ProfileAttributesEntry*> entries = | 212 std::vector<ProfileAttributesEntry*> entries = |
213 storage()->GetAllProfilesAttributes(); | 213 storage()->GetAllProfilesAttributes(); |
214 for (auto& entry : entries) { | 214 for (auto* entry : entries) { |
215 EXPECT_NE(GetProfilePath("testing_profile_path0"), entry->GetPath()); | 215 EXPECT_NE(GetProfilePath("testing_profile_path0"), entry->GetPath()); |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 TEST_F(ProfileAttributesStorageTest, InitialValues) { | 219 TEST_F(ProfileAttributesStorageTest, InitialValues) { |
220 AddTestingProfile(); | 220 AddTestingProfile(); |
221 | 221 |
222 ProfileAttributesEntry* entry; | 222 ProfileAttributesEntry* entry; |
223 ASSERT_TRUE(storage()->GetProfileAttributesWithPath( | 223 ASSERT_TRUE(storage()->GetProfileAttributesWithPath( |
224 GetProfilePath("testing_profile_path0"), &entry)); | 224 GetProfilePath("testing_profile_path0"), &entry)); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 icon_index, | 429 icon_index, |
430 std::string()); | 430 std::string()); |
431 } | 431 } |
432 | 432 |
433 for (int iter = 0; iter < num_iterations; ++iter) { | 433 for (int iter = 0; iter < num_iterations; ++iter) { |
434 // All icons are used up, expect any valid icon. | 434 // All icons are used up, expect any valid icon. |
435 ASSERT_GT(total_icon_count, | 435 ASSERT_GT(total_icon_count, |
436 storage()->ChooseAvatarIconIndexForNewProfile()); | 436 storage()->ChooseAvatarIconIndexForNewProfile()); |
437 } | 437 } |
438 } | 438 } |
OLD | NEW |