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

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

Issue 884923004: [Profiles] Delete test-only method from the ProfileInfoCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 57c2e338b0132f3e43721bdb9c3857dfc9eeb202..d3e6d474ce679c59650fa5d027dbdb9dda37689d 100644
--- a/chrome/browser/profiles/profile_info_cache_unittest.cc
+++ b/chrome/browser/profiles/profile_info_cache_unittest.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_browser_process.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/notification_observer.h"
@@ -530,7 +531,19 @@ TEST_F(ProfileInfoCacheTest, AddStubProfile) {
ASSERT_EQ(4U, GetCache()->GetNumberOfProfiles());
// Check that the profiles can be extracted from the local state.
- std::vector<base::string16> names = ProfileInfoCache::GetProfileNames();
+ std::vector<base::string16> names;
+ PrefService* local_state = g_browser_process->local_state();
+ const base::DictionaryValue* cache = local_state->GetDictionary(
+ prefs::kProfileInfoCache);
+ base::string16 name;
+ for (base::DictionaryValue::Iterator it(*cache); !it.IsAtEnd();
+ it.Advance()) {
+ const base::DictionaryValue* info = NULL;
+ it.value().GetAsDictionary(&info);
+ info->GetString("name", &name);
+ names.push_back(name);
+ }
+
for (size_t i = 0; i < 4; i++)
ASSERT_FALSE(names[i].empty());
}
« 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