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

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

Issue 337011: NTP: Allow hiding tips and bookmark sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
===================================================================
--- chrome/browser/dom_ui/shown_sections_handler_unittest.cc (revision 0)
+++ chrome/browser/dom_ui/shown_sections_handler_unittest.cc (revision 0)
@@ -0,0 +1,32 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/dom_ui/shown_sections_handler.h"
+
+#include "base/file_path.h"
+#include "base/scoped_ptr.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+class ShownSectionsHandlerTest : public testing::Test {
+};
+
+TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) {
+ PrefService pref(FilePath(), NULL);
+
+ // Set an *old* value
+ pref.RegisterIntegerPref(prefs::kNTPShownSections, 0);
+ pref.SetInteger(prefs::kNTPShownSections, THUMB);
+
+ ShownSectionsHandler::MigrateUserPrefs(&pref, 0, 1);
+
+ int shown_sections = pref.GetInteger(prefs::kNTPShownSections);
+
+ 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);
+}
Property changes on: chrome\browser\dom_ui\shown_sections_handler_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« 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