Index: chrome/browser/dom_ui/shown_sections_handler_unittest.cc |
diff --git a/chrome/browser/dom_ui/shown_sections_handler_unittest.cc b/chrome/browser/dom_ui/shown_sections_handler_unittest.cc |
index 2f9e59ba2c5eae7e100ce773c0f2458058e78934..48ca9a1c6d4abef7fba3d9e1f45fade61c71145c 100644 |
--- a/chrome/browser/dom_ui/shown_sections_handler_unittest.cc |
+++ b/chrome/browser/dom_ui/shown_sections_handler_unittest.cc |
@@ -22,8 +22,28 @@ TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) { |
pref->RegisterIntegerPref(prefs::kNTPShownSections, 0); |
pref->SetInteger(prefs::kNTPShownSections, THUMB); |
- ShownSectionsHandler::MigrateUserPrefs(pref.get(), 0, 3); |
+ ShownSectionsHandler::MigrateUserPrefs(pref.get(), 0, 1); |
int shown_sections = pref->GetInteger(prefs::kNTPShownSections); |
- EXPECT_EQ(APPS, shown_sections); |
+ |
+ EXPECT_TRUE(shown_sections & THUMB); |
+ EXPECT_FALSE(shown_sections & LIST); |
+ EXPECT_FALSE(shown_sections & RECENT); |
+ EXPECT_TRUE(shown_sections & TIPS); |
+ EXPECT_TRUE(shown_sections & SYNC); |
+} |
+ |
+TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs1To2) { |
+ scoped_ptr<PrefService> pref(new TestingPrefService); |
+ |
+ // Set an *old* value |
+ pref->RegisterIntegerPref(prefs::kNTPShownSections, 0); |
+ pref->SetInteger(prefs::kNTPShownSections, LIST); |
+ |
+ ShownSectionsHandler::MigrateUserPrefs(pref.get(), 1, 2); |
+ |
+ int shown_sections = pref->GetInteger(prefs::kNTPShownSections); |
+ |
+ EXPECT_TRUE(shown_sections & THUMB); |
+ EXPECT_FALSE(shown_sections & LIST); |
} |