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

Unified Diff: chrome/browser/ui/app_list/app_list_service_unittest.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 | « no previous file | chrome/browser/ui/app_list/profile_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_list_service_unittest.cc
diff --git a/chrome/browser/ui/app_list/app_list_service_unittest.cc b/chrome/browser/ui/app_list/app_list_service_unittest.cc
index 812d638628b560a1a5fd619ecaf0ed3dd4e766f5..55f99687a8a0b0f9331738a177c7574d89f3258b 100644
--- a/chrome/browser/ui/app_list/app_list_service_unittest.cc
+++ b/chrome/browser/ui/app_list/app_list_service_unittest.cc
@@ -86,7 +86,6 @@ class AppListServiceUnitTest : public testing::Test {
protected:
void SetupWithCommandLine(const base::CommandLine& command_line) {
user_data_dir_ = base::FilePath(FILE_PATH_LITERAL("udd"));
- initial_profile_ = "ip";
profile1_.reset(
new FakeProfile("p1", user_data_dir_.AppendASCII("profile1")));
profile2_.reset(
@@ -100,7 +99,7 @@ class AppListServiceUnitTest : public testing::Test {
factory.set_user_prefs(make_scoped_refptr(new TestingPrefStore));
local_state_ = factory.Create(pref_registry).Pass();
- profile_store_ = new FakeProfileStore(user_data_dir_, initial_profile_);
+ profile_store_ = new FakeProfileStore(user_data_dir_, local_state_.get());
service_.reset(new TestingAppListServiceImpl(
command_line,
local_state_.get(),
@@ -113,7 +112,6 @@ class AppListServiceUnitTest : public testing::Test {
}
base::FilePath user_data_dir_;
- std::string initial_profile_;
scoped_ptr<PrefService> local_state_;
FakeProfileStore* profile_store_;
scoped_ptr<TestingAppListServiceImpl> service_;
@@ -142,8 +140,12 @@ TEST_F(AppListServiceUnitTest, ShowingForProfileLoadsAProfile) {
TEST_F(AppListServiceUnitTest, RemovedProfileResetsToInitialProfile) {
EnableAppList();
profile_store_->RemoveProfile(profile1_.get());
+
+ // kAppListProfile should have been cleared, and therefore GetProfilePath
+ // should return the initial profile.
+ EXPECT_EQ("", local_state_->GetString(prefs::kAppListProfile));
base::FilePath initial_profile_path =
- user_data_dir_.AppendASCII(initial_profile_);
+ user_data_dir_.AppendASCII(chrome::kInitialProfile);
EXPECT_EQ(initial_profile_path,
service_->GetProfilePath(profile_store_->GetUserDataDir()));
}
@@ -154,6 +156,8 @@ TEST_F(AppListServiceUnitTest,
EnableAppList();
profile_store_->RemoveProfile(profile1_.get());
+ // kAppListProfile should have been set to kProfileLastUsed.
+ EXPECT_EQ("last-used", local_state_->GetString(prefs::kAppListProfile));
base::FilePath last_used_profile_path =
user_data_dir_.AppendASCII("last-used");
EXPECT_EQ(last_used_profile_path,
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/profile_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698