OLD | NEW |
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/policy/managed_prefs_banner_base.h" | 5 #include "chrome/browser/policy/managed_prefs_banner_base.h" |
6 #include "chrome/browser/prefs/dummy_pref_store.h" | |
7 #include "chrome/common/pref_names.h" | 6 #include "chrome/common/pref_names.h" |
8 #include "chrome/test/testing_pref_service.h" | 7 #include "chrome/test/testing_pref_service.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 8 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 | 10 |
12 namespace policy { | 11 namespace policy { |
13 | 12 |
14 // Tests whether managed preferences banner base functionality correctly | 13 // Tests whether managed preferences banner base functionality correctly |
15 // determines banner visiblity. | 14 // determines banner visiblity. |
16 class ManagedPrefsBannerBaseTest : public testing::Test { | 15 class ManagedPrefsBannerBaseTest : public testing::Test { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 user_prefs_->SetBoolean(prefs::kHomePageIsNewTabPage, true); | 74 user_prefs_->SetBoolean(prefs::kHomePageIsNewTabPage, true); |
76 EXPECT_CALL(banner, OnUpdateVisibility()).Times(1); | 75 EXPECT_CALL(banner, OnUpdateVisibility()).Times(1); |
77 user_prefs_->SetManagedPref(prefs::kSearchSuggestEnabled, | 76 user_prefs_->SetManagedPref(prefs::kSearchSuggestEnabled, |
78 Value::CreateBooleanValue(false)); | 77 Value::CreateBooleanValue(false)); |
79 EXPECT_CALL(banner, OnUpdateVisibility()).Times(1); | 78 EXPECT_CALL(banner, OnUpdateVisibility()).Times(1); |
80 local_state_->SetManagedPref(prefs::kMetricsReportingEnabled, | 79 local_state_->SetManagedPref(prefs::kMetricsReportingEnabled, |
81 Value::CreateBooleanValue(true)); | 80 Value::CreateBooleanValue(true)); |
82 } | 81 } |
83 | 82 |
84 } // namespace policy | 83 } // namespace policy |
OLD | NEW |