Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: chrome/browser/profiles/profile_info_cache_unittest.cc

Issue 23528008: Don't use path expansion for profile dictionaries in LocalState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache_unittest.cc
diff --git a/chrome/browser/profiles/profile_info_cache_unittest.cc b/chrome/browser/profiles/profile_info_cache_unittest.cc
index 51e1fd456e30b63b3f939c6f9fb155abd94be296..1d5e6df7d0119a42ab26f372121b4fd412b5cb3a 100644
--- a/chrome/browser/profiles/profile_info_cache_unittest.cc
+++ b/chrome/browser/profiles/profile_info_cache_unittest.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/profiles/profile_info_cache_unittest.h"
+#include <vector>
+
#include "base/prefs/testing_pref_service.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -459,4 +461,37 @@ TEST_F(ProfileInfoCacheTest, CreateManagedTestingProfile) {
}
}
+TEST_F(ProfileInfoCacheTest, AddStubProfile) {
+ EXPECT_EQ(0u, GetCache()->GetNumberOfProfiles());
+
+ // Add some profiles with and without a '.' in their paths.
+ const struct {
+ const char* profile_path;
+ const char* profile_name;
+ } kTestCases[] = {
+ { "path.test0", "name_0" },
+ { "path_test1", "name_1" },
+ { "path.test2", "name_2" },
+ { "path_test3", "name_3" },
+ };
+
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kTestCases); ++i) {
+ base::FilePath profile_path = GetProfilePath(kTestCases[i].profile_path);
+ string16 profile_name = ASCIIToUTF16(kTestCases[i].profile_name);
+
+ GetCache()->AddProfileToCache(profile_path, profile_name, string16(), i,
+ "");
+
+ EXPECT_EQ(profile_path, GetCache()->GetPathOfProfileAtIndex(i));
+ EXPECT_EQ(profile_name, GetCache()->GetNameOfProfileAtIndex(i));
+ }
+
+ ASSERT_EQ(4U, GetCache()->GetNumberOfProfiles());
+
+ // Check that the profiles can be extracted from the local state.
+ std::vector<string16> names = ProfileInfoCache::GetProfileNames();
+ for (size_t i = 0; i < 4; i++)
+ ASSERT_FALSE(names[i].empty());
+}
+
} // namespace
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698