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

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

Issue 3203008: Move prefs-related files under chrome/browser/ into a prefs/ subdir. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/scoped_ptr.h" 7 #include "base/scoped_ptr.h"
8 #include "chrome/browser/chrome_thread.h" 8 #include "chrome/browser/chrome_thread.h"
9 #include "chrome/browser/pref_value_store.h" 9 #include "chrome/browser/prefs/pref_value_store.h"
10 #include "chrome/common/json_pref_store.h" 10 #include "chrome/common/json_pref_store.h"
11 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
12 #include "chrome/test/testing_pref_service.h" 12 #include "chrome/test/testing_pref_service.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 class ShownSectionsHandlerTest : public testing::Test { 15 class ShownSectionsHandlerTest : public testing::Test {
16 }; 16 };
17 17
18 TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) { 18 TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) {
19 scoped_ptr<PrefService> pref(new TestingPrefService); 19 scoped_ptr<PrefService> pref(new TestingPrefService);
(...skipping 20 matching lines...) Expand all
40 pref->RegisterIntegerPref(prefs::kNTPShownSections, 0); 40 pref->RegisterIntegerPref(prefs::kNTPShownSections, 0);
41 pref->SetInteger(prefs::kNTPShownSections, LIST); 41 pref->SetInteger(prefs::kNTPShownSections, LIST);
42 42
43 ShownSectionsHandler::MigrateUserPrefs(pref.get(), 1, 2); 43 ShownSectionsHandler::MigrateUserPrefs(pref.get(), 1, 2);
44 44
45 int shown_sections = pref->GetInteger(prefs::kNTPShownSections); 45 int shown_sections = pref->GetInteger(prefs::kNTPShownSections);
46 46
47 EXPECT_TRUE(shown_sections & THUMB); 47 EXPECT_TRUE(shown_sections & THUMB);
48 EXPECT_FALSE(shown_sections & LIST); 48 EXPECT_FALSE(shown_sections & LIST);
49 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698