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

Unified Diff: chrome/browser/dom_ui/shown_sections_handler_unittest.cc

Issue 3292003: De-suck the NTP a bit more: (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Fix unit test Created 10 years, 4 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/dom_ui/shown_sections_handler.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/dom_ui/shown_sections_handler.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698