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

Unified Diff: chrome/browser/prefs/session_startup_pref_unittest.cc

Issue 10702040: Cleanup & tests for the mac startup pref migration. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: reverting protector changes Created 8 years, 6 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/prefs/session_startup_pref.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/session_startup_pref_unittest.cc
diff --git a/chrome/browser/prefs/session_startup_pref_unittest.cc b/chrome/browser/prefs/session_startup_pref_unittest.cc
index a7702bba4d55318eb547b6e900b8d630b0953584..207cbcf7971a6a9dacec8b4a9d50f748e9c04580 100644
--- a/chrome/browser/prefs/session_startup_pref_unittest.cc
+++ b/chrome/browser/prefs/session_startup_pref_unittest.cc
@@ -159,3 +159,23 @@ TEST_F(SessionStartupPrefTest, HomePageMigrationHomepageIsNTP) {
EXPECT_EQ(SessionStartupPref::DEFAULT, pref.type);
}
+
+#if defined(OS_MACOSX)
+// See SessionStartupPref::MigrateMacDefaultPrefIfNecessary.
+TEST_F(SessionStartupPrefTest, MacDefaultStartupPrefMigration) {
+ if (!restore_utils::IsWindowRestoreEnabled())
+ return;
+
+ // Use an old profile.
+ pref_service_->SetString(prefs::kProfileCreatedByVersion, "19.0.0.0");
+ ASSERT_TRUE(SessionStartupPref::TypeIsDefault(pref_service_.get()));
+
+ // Trigger the migration.
+ SessionStartupPref pref = SessionStartupPref::GetStartupPref(
+ pref_service_.get());
+
+ // The pref is now explicit.
+ EXPECT_EQ(SessionStartupPref::LAST, pref.type);
+ EXPECT_FALSE(SessionStartupPref::TypeIsDefault(pref_service_.get()));
+}
+#endif
« no previous file with comments | « chrome/browser/prefs/session_startup_pref.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698