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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 GetCache()->GetIndexOfProfileWithPath(profile_path)); | 71 GetCache()->GetIndexOfProfileWithPath(profile_path)); |
72 EXPECT_TRUE(profile_names_.find(profile_name) != profile_names_.end()); | 72 EXPECT_TRUE(profile_names_.find(profile_name) != profile_names_.end()); |
73 } | 73 } |
74 | 74 |
75 ProfileInfoCache* ProfileNameVerifierObserver::GetCache() { | 75 ProfileInfoCache* ProfileNameVerifierObserver::GetCache() { |
76 return testing_profile_manager_->profile_info_cache(); | 76 return testing_profile_manager_->profile_info_cache(); |
77 } | 77 } |
78 | 78 |
79 ProfileInfoCacheTest::ProfileInfoCacheTest() | 79 ProfileInfoCacheTest::ProfileInfoCacheTest() |
80 : testing_profile_manager_( | 80 : testing_profile_manager_( |
81 static_cast<TestingBrowserProcess*>(g_browser_process)), | 81 TestingBrowserProcess::GetGlobal()), |
82 ui_thread_(BrowserThread::UI, &ui_loop_), | 82 ui_thread_(BrowserThread::UI, &ui_loop_), |
83 file_thread_(BrowserThread::FILE, &ui_loop_), | 83 file_thread_(BrowserThread::FILE, &ui_loop_), |
84 name_observer_(&testing_profile_manager_) { | 84 name_observer_(&testing_profile_manager_) { |
85 } | 85 } |
86 | 86 |
87 ProfileInfoCacheTest::~ProfileInfoCacheTest() { | 87 ProfileInfoCacheTest::~ProfileInfoCacheTest() { |
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()); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 GetCache()->SetIsUsingGAIANameOfProfileAtIndex(0, true); | 407 GetCache()->SetIsUsingGAIANameOfProfileAtIndex(0, true); |
408 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(0, true); | 408 GetCache()->SetIsUsingGAIAPictureOfProfileAtIndex(0, true); |
409 | 409 |
410 // Verify that the profile name and picture are not empty. | 410 // Verify that the profile name and picture are not empty. |
411 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(0)); | 411 EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(0)); |
412 EXPECT_TRUE(gfx::test::IsEqual( | 412 EXPECT_TRUE(gfx::test::IsEqual( |
413 profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0))); | 413 profile_image, GetCache()->GetAvatarIconOfProfileAtIndex(0))); |
414 } | 414 } |
415 | 415 |
416 } // namespace | 416 } // namespace |
OLD | NEW |