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

Unified Diff: chrome/browser/ui/app_list/test/fake_profile_store.cc

Issue 1134533007: Fixed AppListServceUnitTest so it tests what it says it's testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bauerb-profiles-ephemeral
Patch Set: Remove explicit. Created 5 years, 7 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/ui/app_list/test/fake_profile_store.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/test/fake_profile_store.cc
diff --git a/chrome/browser/ui/app_list/test/fake_profile_store.cc b/chrome/browser/ui/app_list/test/fake_profile_store.cc
index 7966171f0078874e420fb26a220f1010142060ee..549315bd300c50e03de71afbb03f119e6b163d52 100644
--- a/chrome/browser/ui/app_list/test/fake_profile_store.cc
+++ b/chrome/browser/ui/app_list/test/fake_profile_store.cc
@@ -4,12 +4,14 @@
#include "chrome/browser/ui/app_list/test/fake_profile_store.h"
+#include "base/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_constants.h"
+#include "chrome/common/pref_names.h"
FakeProfileStore::FakeProfileStore(const base::FilePath& user_data_dir,
- const std::string& last_used_profile)
- : user_data_dir_(user_data_dir),
- last_used_profile_name_(last_used_profile) {
+ PrefService* local_state)
+ : user_data_dir_(user_data_dir), local_state_(local_state) {
}
FakeProfileStore::~FakeProfileStore() {
@@ -62,7 +64,13 @@ base::FilePath FakeProfileStore::GetUserDataDir() {
}
std::string FakeProfileStore::GetLastUsedProfileName() {
- return last_used_profile_name_;
+ std::string profile_name = local_state_->GetString(prefs::kProfileLastUsed);
+
+ if (!profile_name.empty())
+ return profile_name;
+
+ // If there is no last used profile recorded, use the initial profile.
+ return chrome::kInitialProfile;
}
bool FakeProfileStore::IsProfileSupervised(const base::FilePath& path) {
« no previous file with comments | « chrome/browser/ui/app_list/test/fake_profile_store.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698