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

Unified Diff: chrome/browser/dom_ui/new_tab_ui_uitest.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/new_tab_ui.cc ('k') | chrome/browser/dom_ui/shown_sections_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/new_tab_ui_uitest.cc
===================================================================
--- chrome/browser/dom_ui/new_tab_ui_uitest.cc (revision 30391)
+++ chrome/browser/dom_ui/new_tab_ui_uitest.cc (working copy)
@@ -4,7 +4,11 @@
#include "chrome/test/ui/ui_test.h"
+#include "base/file_path.h"
#include "chrome/app/chrome_dll_resource.h"
+#include "chrome/browser/dom_ui/new_tab_ui.h"
+#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
#include "chrome/test/automation/browser_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/automation/window_proxy.h"
@@ -54,3 +58,25 @@
}
EXPECT_EQ(0, filler_thumbnails_count);
}
+
+TEST_F(NewTabUITest, UpdateUserPrefsVersion) {
+ PrefService prefs(FilePath(), NULL);
+
+ // Does the migration
+ NewTabUI::RegisterUserPrefs(&prefs);
+
+ ASSERT_EQ(NewTabUI::current_pref_version(),
+ prefs.GetInteger(prefs::kNTPPrefVersion));
+
+ // Reset the version
+ prefs.ClearPref(prefs::kNTPPrefVersion);
+ ASSERT_EQ(0, prefs.GetInteger(prefs::kNTPPrefVersion));
+
+ bool migrated = NewTabUI::UpdateUserPrefsVersion(&prefs);
+ ASSERT_TRUE(migrated);
+ ASSERT_EQ(NewTabUI::current_pref_version(),
+ prefs.GetInteger(prefs::kNTPPrefVersion));
+
+ migrated = NewTabUI::UpdateUserPrefsVersion(&prefs);
+ ASSERT_FALSE(migrated);
+}
Property changes on: chrome\browser\dom_ui\new_tab_ui_uitest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/dom_ui/shown_sections_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698