Lines Matching defs:GetCache

50   base::string16 profile_name = GetCache()->GetNameOfProfileAtIndex(
51 GetCache()->GetIndexOfProfileWithPath(profile_path));
58 base::string16 profile_name = GetCache()->GetNameOfProfileAtIndex(
59 GetCache()->GetIndexOfProfileWithPath(profile_path));
73 base::string16 new_profile_name = GetCache()->GetNameOfProfileAtIndex(
74 GetCache()->GetIndexOfProfileWithPath(profile_path));
83 base::string16 profile_name = GetCache()->GetNameOfProfileAtIndex(
84 GetCache()->GetIndexOfProfileWithPath(profile_path));
88 ProfileInfoCache* ProfileNameVerifierObserver::GetCache() {
111 ProfileInfoCache* ProfileInfoCacheTest::GetCache() {
126 EXPECT_EQ(0u, GetCache()->GetNumberOfProfiles());
139 GetCache()->AddProfileToCache(profile_path, profile_name, base::string16(),
141 GetCache()->SetBackgroundStatusOfProfileAtIndex(i, true);
143 GetCache()->SetGAIANameOfProfileAtIndex(i, gaia_name);
145 EXPECT_EQ(i + 1, GetCache()->GetNumberOfProfiles());
146 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(i));
147 EXPECT_EQ(profile_path, GetCache()->GetPathOfProfileAtIndex(i));
149 GetCache()->GetAvatarIconOfProfileAtIndex(i).ToSkBitmap();
152 EXPECT_EQ(i == 3, GetCache()->ProfileIsSupervisedAtIndex(i));
153 EXPECT_EQ(i == 3, GetCache()->IsOmittedProfileAtIndex(i));
155 GetCache()->GetSupervisedUserIdOfProfileAtIndex(i));
161 EXPECT_EQ(4u, GetCache()->GetNumberOfProfiles());
165 EXPECT_EQ(i, GetCache()->GetIndexOfProfileWithPath(profile_path));
168 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(i));
169 EXPECT_EQ(i, GetCache()->GetAvatarIconIndexOfProfileAtIndex(i));
170 EXPECT_EQ(true, GetCache()->GetBackgroundStatusOfProfileAtIndex(i));
172 EXPECT_EQ(gaia_name, GetCache()->GetGAIANameOfProfileAtIndex(i));
177 EXPECT_EQ(0u, GetCache()->GetNumberOfProfiles());
180 GetCache()->AddProfileToCache(path_1, ASCIIToUTF16("name_1"),
182 EXPECT_EQ(1u, GetCache()->GetNumberOfProfiles());
186 GetCache()->AddProfileToCache(path_2, name_2, base::string16(), 0,
188 EXPECT_EQ(2u, GetCache()->GetNumberOfProfiles());
190 GetCache()->DeleteProfileFromCache(path_1);
191 EXPECT_EQ(1u, GetCache()->GetNumberOfProfiles());
192 EXPECT_EQ(name_2, GetCache()->GetNameOfProfileAtIndex(0));
194 GetCache()->DeleteProfileFromCache(path_2);
195 EXPECT_EQ(0u, GetCache()->GetNumberOfProfiles());
199 GetCache()->AddProfileToCache(
202 GetCache()->AddProfileToCache(
207 GetCache()->SetNameOfProfileAtIndex(1, new_name);
208 EXPECT_EQ(new_name, GetCache()->GetNameOfProfileAtIndex(1));
209 EXPECT_NE(new_name, GetCache()->GetNameOfProfileAtIndex(0));
212 GetCache()->SetUserNameOfProfileAtIndex(1, new_user_name);
213 EXPECT_EQ(new_user_name, GetCache()->GetUserNameOfProfileAtIndex(1));
214 EXPECT_NE(new_user_name, GetCache()->GetUserNameOfProfileAtIndex(0));
217 GetCache()->SetAvatarIconOfProfileAtIndex(1, new_icon_index);
219 GetCache()->GetAvatarIconOfProfileAtIndex(1);
224 GetCache()->AddProfileToCache(
228 GetCache()->AddProfileToCache(
232 EXPECT_EQ(name_a, GetCache()->GetNameOfProfileAtIndex(0));
233 EXPECT_EQ(name_c, GetCache()->GetNameOfProfileAtIndex(1));
237 GetCache()->AddProfileToCache(
241 EXPECT_EQ(name_a, GetCache()->GetNameOfProfileAtIndex(0));
242 EXPECT_EQ(name_b, GetCache()->GetNameOfProfileAtIndex(1));
243 EXPECT_EQ(name_c, GetCache()->GetNameOfProfileAtIndex(2));
247 GetCache()->SetNameOfProfileAtIndex(0, name_a);
250 EXPECT_EQ(name_b, GetCache()->GetNameOfProfileAtIndex(0));
251 EXPECT_EQ(name_c, GetCache()->GetNameOfProfileAtIndex(1));
252 EXPECT_EQ(name_a, GetCache()->GetNameOfProfileAtIndex(2));
255 GetCache()->DeleteProfileFromCache(GetProfilePath("path_c"));
258 EXPECT_EQ(name_b, GetCache()->GetNameOfProfileAtIndex(0));
259 EXPECT_EQ(name_a, GetCache()->GetNameOfProfileAtIndex(1));
263 GetCache()->AddProfileToCache(
266 GetCache()->AddProfileToCache(
270 EXPECT_FALSE(GetCache()->GetBackgroundStatusOfProfileAtIndex(0));
271 EXPECT_FALSE(GetCache()->GetBackgroundStatusOfProfileAtIndex(1));
273 GetCache()->SetBackgroundStatusOfProfileAtIndex(1, true);
275 EXPECT_FALSE(GetCache()->GetBackgroundStatusOfProfileAtIndex(0));
276 EXPECT_TRUE(GetCache()->GetBackgroundStatusOfProfileAtIndex(1));
278 GetCache()->SetBackgroundStatusOfProfileAtIndex(0, true);
280 EXPECT_TRUE(GetCache()->GetBackgroundStatusOfProfileAtIndex(0));
281 EXPECT_TRUE(GetCache()->GetBackgroundStatusOfProfileAtIndex(1));
283 GetCache()->SetBackgroundStatusOfProfileAtIndex(1, false);
285 EXPECT_TRUE(GetCache()->GetBackgroundStatusOfProfileAtIndex(0));
286 EXPECT_FALSE(GetCache()->GetBackgroundStatusOfProfileAtIndex(1));
290 GetCache()->AddProfileToCache(
293 EXPECT_EQ(base::Time(), GetCache()->GetProfileActiveTimeAtIndex(0));
300 GetCache()->SetProfileActiveTimeAtIndex(0);
303 EXPECT_LE(before, GetCache()->GetProfileActiveTimeAtIndex(0));
304 EXPECT_GE(after, GetCache()->GetProfileActiveTimeAtIndex(0));
308 GetCache()->AddProfileToCache(
312 GetCache()->AddProfileToCache(
316 int index1 = GetCache()->GetIndexOfProfileWithPath(GetProfilePath("path_1"));
317 int index2 = GetCache()->GetIndexOfProfileWithPath(GetProfilePath("path_2"));
320 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(index1).empty());
321 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(index2).empty());
325 GetCache()->SetGAIANameOfProfileAtIndex(index2, gaia_name);
326 index1 = GetCache()->GetIndexOfProfileWithPath(GetProfilePath("path_1"));
327 index2 = GetCache()->GetIndexOfProfileWithPath(GetProfilePath("path_2"));
330 EXPECT_TRUE(GetCache()->GetGAIANameOfProfileAtIndex(index1).empty());
331 EXPECT_EQ(gaia_name, GetCache()->GetGAIANameOfProfileAtIndex(index2));
332 EXPECT_EQ(gaia_name, GetCache()->GetNameOfProfileAtIndex(index2));
336 GetCache()->SetNameOfProfileAtIndex(index2, custom_name);
337 GetCache()->SetProfileIsUsingDefaultNameAtIndex(index2, false);
339 index1 = GetCache()->GetIndexOfProfileWithPath(GetProfilePath("path_1"));
340 index2 = GetCache()->GetIndexOfProfileWithPath(GetProfilePath("path_2"));
342 EXPECT_EQ(custom_name, GetCache()->GetNameOfProfileAtIndex(index2));
343 EXPECT_EQ(gaia_name, GetCache()->GetGAIANameOfProfileAtIndex(index2));
350 GetCache()->AddProfileToCache(
353 GetCache()->AddProfileToCache(
358 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0));
359 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(1));
360 EXPECT_FALSE(GetCache()->IsUsingGAIAPictureOfProfileAtIndex(0));
361 EXPECT_FALSE(GetCache()->IsUsingGAIAPictureOfProfileAtIndex(1));
364 EXPECT_TRUE(GetCache()->ProfileIsUsingDefaultAvatarAtIndex(0));
365 EXPECT_TRUE(GetCache()->ProfileIsUsingDefaultAvatarAtIndex(1));
371 default_avatar_image, GetCache()->GetAvatarIconOfProfileAtIndex(1)));
376 GetCache()->SetGAIAPictureOfProfileAtIndex(1, &gaia_image);
377 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0));
379 gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(1)));
382 EXPECT_TRUE(GetCache()->ProfileIsUsingDefaultAvatarAtIndex(1));
383 EXPECT_TRUE(GetCache()->IsUsingGAIAPictureOfProfileAtIndex(1));
385 gaia_image, GetCache()->GetAvatarIconOfProfileAtIndex(1)));
388 GetCache()->SetAvatarIconOfProfileAtIndex(1, kOtherAvatarIndex);
389 GetCache()->SetProfileIsUsingDefaultAvatarAtIndex(1, false);
390 EXPECT_FALSE(GetCache()->ProfileIsUsingDefaultAvatarAtIndex(1));
391 EXPECT_FALSE(GetCache()->IsUsingGAIAPictureOfProfileAtIndex(1));
397 other_avatar_image, GetCache()->GetAvatarIconOfProfileAtIndex(1)));
400 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(1, true);
401 EXPECT_TRUE(GetCache()->IsUsingGAIAPictureOfProfileAtIndex(1));
403 gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(1)));
405 gaia_image, GetCache()->GetAvatarIconOfProfileAtIndex(1)));
409 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(1, false);
410 EXPECT_FALSE(GetCache()->IsUsingGAIAPictureOfProfileAtIndex(1));
412 gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(1)));
414 other_avatar_image, GetCache()->GetAvatarIconOfProfileAtIndex(1)));
418 GetCache()->AddProfileToCache(
426 GetCache()->SetGAIAPictureOfProfileAtIndex(0, &gaia_image);
428 gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(0)));
439 EXPECT_EQ(NULL, GetCache()->GetGAIAPictureOfProfileAtIndex(0));
442 gaia_image, *GetCache()->GetGAIAPictureOfProfileAtIndex(0)));
446 GetCache()->AddProfileToCache(
449 EXPECT_FALSE(GetCache()->ProfileIsSupervisedAtIndex(0));
451 GetCache()->SetSupervisedUserIdOfProfileAtIndex(0, "TEST_ID");
452 EXPECT_TRUE(GetCache()->ProfileIsSupervisedAtIndex(0));
453 EXPECT_EQ("TEST_ID", GetCache()->GetSupervisedUserIdOfProfileAtIndex(0));
456 EXPECT_TRUE(GetCache()->ProfileIsSupervisedAtIndex(0));
458 GetCache()->SetSupervisedUserIdOfProfileAtIndex(0, std::string());
459 EXPECT_FALSE(GetCache()->ProfileIsSupervisedAtIndex(0));
460 EXPECT_EQ("", GetCache()->GetSupervisedUserIdOfProfileAtIndex(0));
469 GetCache()->AddProfileToCache(
474 GetCache()->SetGAIANameOfProfileAtIndex(0, base::string16());
475 GetCache()->SetGAIAPictureOfProfileAtIndex(0, NULL);
476 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(0, true);
479 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(0));
481 profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0)));
490 for (size_t i = 0; i < GetCache()->GetNumberOfProfiles(); i++) {
492 GetCache()->GetNameOfProfileAtIndex(i) == supervised_user_name;
493 EXPECT_EQ(is_supervised, GetCache()->ProfileIsSupervisedAtIndex(i));
496 GetCache()->GetSupervisedUserIdOfProfileAtIndex(i));
506 EXPECT_EQ(0u, GetCache()->GetNumberOfProfiles());
523 GetCache()->AddProfileToCache(profile_path, profile_name, base::string16(),
526 EXPECT_EQ(profile_path, GetCache()->GetPathOfProfileAtIndex(i));
527 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(i));
530 ASSERT_EQ(4U, GetCache()->GetNumberOfProfiles());
543 EXPECT_EQ(0U, GetCache()->GetNumberOfProfiles());
545 GetCache()->AddProfileToCache(path_1, ASCIIToUTF16("name_1"),
547 EXPECT_EQ(1U, GetCache()->GetNumberOfProfiles());
550 EXPECT_EQ(0U, GetCache()->cached_avatar_images_.size());
555 EXPECT_EQ(1U, GetCache()->avatar_images_downloads_in_progress_.size());
557 EXPECT_FALSE(GetCache()->GetHighResAvatarOfProfileAtIndex(0));
562 kIconIndex, GetCache()->GetPathOfProfileAtIndex(0), GetCache());
576 EXPECT_EQ(1U, GetCache()->avatar_images_downloads_in_progress_.size());
577 EXPECT_EQ(1U, GetCache()->cached_avatar_images_.size());
578 EXPECT_TRUE(GetCache()->GetHighResAvatarOfProfileAtIndex(0));
579 EXPECT_EQ(GetCache()->cached_avatar_images_[file_name],
580 GetCache()->GetHighResAvatarOfProfileAtIndex(0));
596 EXPECT_EQ(0U, GetCache()->GetNumberOfProfiles());
599 GetCache()->AddProfileToCache(path_1, ASCIIToUTF16("Default Profile"),
602 GetCache()->AddProfileToCache(path_2, ASCIIToUTF16("First user"),
606 GetCache()->AddProfileToCache(path_3, name_3,
610 GetCache()->AddProfileToCache(path_4, name_4,
614 GetCache()->AddProfileToCache(path_5, name_5,
617 EXPECT_EQ(5U, GetCache()->GetNumberOfProfiles());
624 EXPECT_EQ(ASCIIToUTF16("Person 1"), GetCache()->GetNameOfProfileAtIndex(
625 GetCache()->GetIndexOfProfileWithPath(path_1)));
626 EXPECT_EQ(ASCIIToUTF16("Person 3"), GetCache()->GetNameOfProfileAtIndex(
627 GetCache()->GetIndexOfProfileWithPath(path_2)));
631 EXPECT_EQ(name_3, GetCache()->GetNameOfProfileAtIndex(
632 GetCache()->GetIndexOfProfileWithPath(path_3)));
633 EXPECT_EQ(name_4, GetCache()->GetNameOfProfileAtIndex(
634 GetCache()->GetIndexOfProfileWithPath(path_4)));
635 EXPECT_EQ(name_5, GetCache()->GetNameOfProfileAtIndex(
636 GetCache()->GetIndexOfProfileWithPath(path_5)));
644 EXPECT_EQ(0U, GetCache()->GetNumberOfProfiles());
648 GetCache()->AddProfileToCache(path_1, name_1,
652 GetCache()->AddProfileToCache(path_2, name_2,
656 GetCache()->AddProfileToCache(path_3, name_3,
660 GetCache()->AddProfileToCache(path_4, name_4,
662 EXPECT_EQ(4U, GetCache()->GetNumberOfProfiles());
667 EXPECT_EQ(name_1, GetCache()->GetNameOfProfileAtIndex(
668 GetCache()->GetIndexOfProfileWithPath(path_1)));
669 EXPECT_EQ(name_2, GetCache()->GetNameOfProfileAtIndex(
670 GetCache()->GetIndexOfProfileWithPath(path_2)));
671 EXPECT_EQ(name_3, GetCache()->GetNameOfProfileAtIndex(
672 GetCache()->GetIndexOfProfileWithPath(path_3)));
673 EXPECT_EQ(name_4, GetCache()->GetNameOfProfileAtIndex(
674 GetCache()->GetIndexOfProfileWithPath(path_4)));