OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/prefs/pref_value_map.h" | |
10 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
12 #include "base/values.h" | 11 #include "base/values.h" |
13 #include "chrome/browser/prefs/session_startup_pref.h" | 12 #include "chrome/browser/prefs/session_startup_pref.h" |
14 #include "chrome/browser/sessions/restore_on_startup_policy_handler.h" | 13 #include "chrome/browser/sessions/restore_on_startup_policy_handler.h" |
15 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
16 #include "components/policy/core/browser/configuration_policy_handler.h" | 15 #include "components/policy/core/browser/configuration_policy_handler.h" |
17 #include "components/policy/core/browser/policy_error_map.h" | 16 #include "components/policy/core/browser/policy_error_map.h" |
18 #include "components/policy/core/common/policy_map.h" | 17 #include "components/policy/core/common/policy_map.h" |
19 #include "components/policy/core/common/policy_types.h" | 18 #include "components/policy/core/common/policy_types.h" |
| 19 #include "components/prefs/pref_value_map.h" |
20 #include "grit/components_strings.h" | 20 #include "grit/components_strings.h" |
21 #include "policy/policy_constants.h" | 21 #include "policy/policy_constants.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
24 | 24 |
25 namespace policy { | 25 namespace policy { |
26 | 26 |
27 class RestoreOnStartupPolicyHandlerTest : public testing::Test { | 27 class RestoreOnStartupPolicyHandlerTest : public testing::Test { |
28 protected: | 28 protected: |
29 void SetPolicyValue(const std::string& policy, base::Value* value) { | 29 void SetPolicyValue(const std::string& policy, base::Value* value) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 } | 183 } |
184 | 184 |
185 TEST_F(RestoreOnStartupPolicyHandlerTest, ApplyPolicySettings_WrongType) { | 185 TEST_F(RestoreOnStartupPolicyHandlerTest, ApplyPolicySettings_WrongType) { |
186 // Handler expects an int; pass it a bool. | 186 // Handler expects an int; pass it a bool. |
187 SetPolicyValue(key::kRestoreOnStartup, new base::FundamentalValue(false)); | 187 SetPolicyValue(key::kRestoreOnStartup, new base::FundamentalValue(false)); |
188 // The resulting prefs should be empty. | 188 // The resulting prefs should be empty. |
189 EXPECT_TRUE(prefs().begin() == prefs().end()); | 189 EXPECT_TRUE(prefs().begin() == prefs().end()); |
190 } | 190 } |
191 | 191 |
192 } // namespace policy | 192 } // namespace policy |
OLD | NEW |