| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return NULL; | 60 return NULL; |
| 61 } | 61 } |
| 62 return new TestingProfile(file_path, NULL); | 62 return new TestingProfile(file_path, NULL); |
| 63 } | 63 } |
| 64 | 64 |
| 65 virtual Profile* CreateProfileAsyncHelper(const FilePath& path, | 65 virtual Profile* CreateProfileAsyncHelper(const FilePath& path, |
| 66 Delegate* delegate) OVERRIDE { | 66 Delegate* delegate) OVERRIDE { |
| 67 // This is safe while all file operations are done on the FILE thread. | 67 // This is safe while all file operations are done on the FILE thread. |
| 68 BrowserThread::PostTask( | 68 BrowserThread::PostTask( |
| 69 BrowserThread::FILE, FROM_HERE, | 69 BrowserThread::FILE, FROM_HERE, |
| 70 base::IgnoreReturn<bool>(base::Bind(&file_util::CreateDirectory, | 70 base::Bind(base::IgnoreResult(&file_util::CreateDirectory), path)); |
| 71 path))); | |
| 72 | 71 |
| 73 return new TestingProfile(path, this); | 72 return new TestingProfile(path, this); |
| 74 } | 73 } |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 } // namespace testing | 76 } // namespace testing |
| 78 | 77 |
| 79 class ProfileManagerTest : public testing::Test { | 78 class ProfileManagerTest : public testing::Test { |
| 80 protected: | 79 protected: |
| 81 ProfileManagerTest() | 80 ProfileManagerTest() |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 profile->GetPrefs()->GetInteger(prefs::kProfileAvatarIndex); | 377 profile->GetPrefs()->GetInteger(prefs::kProfileAvatarIndex); |
| 379 | 378 |
| 380 size_t profile_index = cache.GetIndexOfProfileWithPath(dest_path); | 379 size_t profile_index = cache.GetIndexOfProfileWithPath(dest_path); |
| 381 | 380 |
| 382 // Check if the profile prefs are the same as the cache prefs | 381 // Check if the profile prefs are the same as the cache prefs |
| 383 EXPECT_EQ(profile_name, | 382 EXPECT_EQ(profile_name, |
| 384 UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_index))); | 383 UTF16ToUTF8(cache.GetNameOfProfileAtIndex(profile_index))); |
| 385 EXPECT_EQ(avatar_index, | 384 EXPECT_EQ(avatar_index, |
| 386 cache.GetAvatarIconIndexOfProfileAtIndex(profile_index)); | 385 cache.GetAvatarIconIndexOfProfileAtIndex(profile_index)); |
| 387 } | 386 } |
| OLD | NEW |