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 <objbase.h> // For CoInitialize(). | 5 #include <objbase.h> // For CoInitialize(). |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // The icon file is not deleted until the profile directory is deleted. | 74 // The icon file is not deleted until the profile directory is deleted. |
75 const base::FilePath icon_path = | 75 const base::FilePath icon_path = |
76 profiles::internal::GetProfileIconPath(profile_path); | 76 profiles::internal::GetProfileIconPath(profile_path); |
77 ASSERT_TRUE(base::PathExists(icon_path)); | 77 ASSERT_TRUE(base::PathExists(icon_path)); |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 base::FilePath CreateProfileDirectory(const string16& profile_name) { | 81 base::FilePath CreateProfileDirectory(const string16& profile_name) { |
82 const base::FilePath profile_path = | 82 const base::FilePath profile_path = |
83 profile_info_cache_->GetUserDataDir().Append(profile_name); | 83 profile_info_cache_->GetUserDataDir().Append(profile_name); |
84 file_util::CreateDirectory(profile_path); | 84 base::CreateDirectory(profile_path); |
85 return profile_path; | 85 return profile_path; |
86 } | 86 } |
87 | 87 |
88 void RunPendingTasks() { | 88 void RunPendingTasks() { |
89 base::MessageLoop::current()->PostTask(FROM_HERE, | 89 base::MessageLoop::current()->PostTask(FROM_HERE, |
90 base::MessageLoop::QuitClosure()); | 90 base::MessageLoop::QuitClosure()); |
91 base::MessageLoop::current()->Run(); | 91 base::MessageLoop::current()->Run(); |
92 } | 92 } |
93 | 93 |
94 void SetupDefaultProfileShortcut(const tracked_objects::Location& location) { | 94 void SetupDefaultProfileShortcut(const tracked_objects::Location& location) { |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 EXPECT_NE(unbadged_icon_1, new_badged_icon_1); | 863 EXPECT_NE(unbadged_icon_1, new_badged_icon_1); |
864 | 864 |
865 // Ensure the icon doesn't change on avatar change without 2 profiles. | 865 // Ensure the icon doesn't change on avatar change without 2 profiles. |
866 profile_info_cache_->SetAvatarIconOfProfileAtIndex(profile_index_1, 1); | 866 profile_info_cache_->SetAvatarIconOfProfileAtIndex(profile_index_1, 1); |
867 RunPendingTasks(); | 867 RunPendingTasks(); |
868 | 868 |
869 std::string unbadged_icon_1_a; | 869 std::string unbadged_icon_1_a; |
870 EXPECT_TRUE(base::ReadFileToString(icon_path_1, &unbadged_icon_1_a)); | 870 EXPECT_TRUE(base::ReadFileToString(icon_path_1, &unbadged_icon_1_a)); |
871 EXPECT_EQ(unbadged_icon_1, unbadged_icon_1_a); | 871 EXPECT_EQ(unbadged_icon_1, unbadged_icon_1_a); |
872 } | 872 } |
OLD | NEW |