| Index: chrome/browser/ui/webui/ntp/shown_sections_handler_unittest.cc
|
| diff --git a/chrome/browser/ui/webui/ntp/shown_sections_handler_unittest.cc b/chrome/browser/ui/webui/ntp/shown_sections_handler_unittest.cc
|
| deleted file mode 100644
|
| index ae071d4c2c8be01e0844cd38f5f99611be6a232a..0000000000000000000000000000000000000000
|
| --- a/chrome/browser/ui/webui/ntp/shown_sections_handler_unittest.cc
|
| +++ /dev/null
|
| @@ -1,43 +0,0 @@
|
| -// Copyright (c) 2011 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/ui/webui/ntp/shown_sections_handler.h"
|
| -
|
| -#include "base/memory/scoped_ptr.h"
|
| -#include "chrome/browser/prefs/pref_value_store.h"
|
| -#include "chrome/common/json_pref_store.h"
|
| -#include "chrome/common/pref_names.h"
|
| -#include "chrome/test/base/testing_pref_service.h"
|
| -#include "testing/gtest/include/gtest/gtest.h"
|
| -
|
| -class ShownSectionsHandlerTest : public testing::Test {
|
| -};
|
| -
|
| -namespace {
|
| -
|
| -int MigratePrefValue(PrefService* prefs, int starting_value) {
|
| - prefs->SetInteger(prefs::kNTPShownSections, starting_value);
|
| - ShownSectionsHandler::MigrateUserPrefs(prefs, 1, 3);
|
| - return prefs->GetInteger(prefs::kNTPShownSections);
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -TEST_F(ShownSectionsHandlerTest, MigrateUserPrefs) {
|
| - scoped_ptr<PrefService> pref(new TestingPrefService);
|
| -
|
| - pref->RegisterIntegerPref(prefs::kNTPShownSections, 0);
|
| -
|
| - EXPECT_EQ(APPS, MigratePrefValue(pref.get(), APPS));
|
| - EXPECT_EQ(THUMB, MigratePrefValue(pref.get(), THUMB));
|
| - EXPECT_EQ(APPS, MigratePrefValue(pref.get(), APPS | THUMB));
|
| -
|
| - // 2 is not currently used, but older state may contain it and we should do
|
| - // something reasonable.
|
| - EXPECT_EQ(THUMB, MigratePrefValue(pref.get(), 3));
|
| -
|
| - // 0 can't correspond to any section, but we should still do something
|
| - // reasonable.
|
| - EXPECT_EQ(THUMB, MigratePrefValue(pref.get(), 0));
|
| -}
|
|
|