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 "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/profiles/profile_info_cache.h" | 10 #include "chrome/browser/profiles/profile_info_cache.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 } | 88 } |
89 | 89 |
90 void ProfileInfoCacheTest::SetUp() { | 90 void ProfileInfoCacheTest::SetUp() { |
91 ASSERT_TRUE(testing_profile_manager_.SetUp()); | 91 ASSERT_TRUE(testing_profile_manager_.SetUp()); |
92 testing_profile_manager_.profile_info_cache()->AddObserver(&name_observer_); | 92 testing_profile_manager_.profile_info_cache()->AddObserver(&name_observer_); |
93 } | 93 } |
94 | 94 |
95 void ProfileInfoCacheTest::TearDown() { | 95 void ProfileInfoCacheTest::TearDown() { |
96 // Drain the UI thread to make sure all tasks are completed. This prevents | 96 // Drain the UI thread to make sure all tasks are completed. This prevents |
97 // memory leaks. | 97 // memory leaks. |
98 ui_loop_.RunAllPending(); | 98 ui_loop_.RunUntilIdle(); |
99 } | 99 } |
100 | 100 |
101 ProfileInfoCache* ProfileInfoCacheTest::GetCache() { | 101 ProfileInfoCache* ProfileInfoCacheTest::GetCache() { |
102 return testing_profile_manager_.profile_info_cache(); | 102 return testing_profile_manager_.profile_info_cache(); |
103 } | 103 } |
104 | 104 |
105 FilePath ProfileInfoCacheTest::GetProfilePath( | 105 FilePath ProfileInfoCacheTest::GetProfilePath( |
106 const std::string& base_name) { | 106 const std::string& base_name) { |
107 return testing_profile_manager_.profile_manager()->user_data_dir(). | 107 return testing_profile_manager_.profile_manager()->user_data_dir(). |
108 AppendASCII(base_name); | 108 AppendASCII(base_name); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 GetCache()->SetIsUsingGAIANameOfProfileAtIndex(0, true); | 406 GetCache()->SetIsUsingGAIANameOfProfileAtIndex(0, true); |
407 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(0, true); | 407 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(0, true); |
408 | 408 |
409 // Verify that the profile name and picture are not empty. | 409 // Verify that the profile name and picture are not empty. |
410 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(0)); | 410 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(0)); |
411 EXPECT_TRUE(gfx::test::IsEqual( | 411 EXPECT_TRUE(gfx::test::IsEqual( |
412 profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0))); | 412 profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0))); |
413 } | 413 } |
414 | 414 |
415 } // namespace | 415 } // namespace |
OLD | NEW |