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

Side by Side Diff: chrome/browser/dom_ui/shown_sections_handler_unittest.cc

Issue 342068: Third patch in getting rid of caching MessageLoop pointers and always using C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/dom_ui/shown_sections_handler.h" 5 #include "chrome/browser/dom_ui/shown_sections_handler.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "chrome/common/pref_service.h" 10 #include "chrome/common/pref_service.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 class ShownSectionsHandlerTest : public testing::Test { 13 class ShownSectionsHandlerTest : public testing::Test {
14 }; 14 };
15 15
16 TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) { 16 TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) {
17 PrefService pref(FilePath(), NULL); 17 PrefService pref((FilePath()));
18 18
19 // Set an *old* value 19 // Set an *old* value
20 pref.RegisterIntegerPref(prefs::kNTPShownSections, 0); 20 pref.RegisterIntegerPref(prefs::kNTPShownSections, 0);
21 pref.SetInteger(prefs::kNTPShownSections, THUMB); 21 pref.SetInteger(prefs::kNTPShownSections, THUMB);
22 22
23 ShownSectionsHandler::MigrateUserPrefs(&pref, 0, 1); 23 ShownSectionsHandler::MigrateUserPrefs(&pref, 0, 1);
24 24
25 int shown_sections = pref.GetInteger(prefs::kNTPShownSections); 25 int shown_sections = pref.GetInteger(prefs::kNTPShownSections);
26 26
27 EXPECT_TRUE(shown_sections & THUMB); 27 EXPECT_TRUE(shown_sections & THUMB);
28 EXPECT_FALSE(shown_sections & LIST); 28 EXPECT_FALSE(shown_sections & LIST);
29 EXPECT_FALSE(shown_sections & RECENT); 29 EXPECT_FALSE(shown_sections & RECENT);
30 EXPECT_TRUE(shown_sections & TIPS); 30 EXPECT_TRUE(shown_sections & TIPS);
31 EXPECT_TRUE(shown_sections & SYNC); 31 EXPECT_TRUE(shown_sections & SYNC);
32 } 32 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui_uitest.cc ('k') | chrome/browser/extensions/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698