| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "chrome/browser/policy/managed_bookmarks_policy_handler.h" | 6 #include "chrome/browser/policy/managed_bookmarks_policy_handler.h" |
| 7 #include "components/bookmarks/common/bookmark_pref_names.h" | 7 #include "components/bookmarks/common/bookmark_pref_names.h" |
| 8 #include "components/policy/core/browser/configuration_policy_pref_store.h" | 8 #include "components/policy/core/browser/configuration_policy_pref_store.h" |
| 9 #include "components/policy/core/browser/configuration_policy_pref_store_test.h" | 9 #include "components/policy/core/browser/configuration_policy_pref_store_test.h" |
| 10 #include "components/policy/core/common/policy_map.h" | 10 #include "components/policy/core/common/policy_map.h" |
| 11 #include "components/policy/core/common/schema.h" | 11 #include "components/policy/core/common/schema.h" |
| 12 #include "policy/policy_constants.h" | 12 #include "policy/policy_constants.h" |
| 13 | 13 |
| 14 #if defined(ENABLE_EXTENSIONS) | 14 #if defined(ENABLE_EXTENSIONS) |
| 15 #include "extensions/common/value_builder.h" | 15 #include "extensions/common/value_builder.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 namespace policy { | 18 namespace policy { |
| 19 | 19 |
| 20 class ManagedBookmarksPolicyHandlerTest | 20 class ManagedBookmarksPolicyHandlerTest |
| 21 : public ConfigurationPolicyPrefStoreTest { | 21 : public ConfigurationPolicyPrefStoreTest { |
| 22 virtual void SetUp() override { | 22 void SetUp() override { |
| 23 Schema chrome_schema = Schema::Wrap(GetChromeSchemaData()); | 23 Schema chrome_schema = Schema::Wrap(GetChromeSchemaData()); |
| 24 handler_list_.AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( | 24 handler_list_.AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( |
| 25 new ManagedBookmarksPolicyHandler(chrome_schema))); | 25 new ManagedBookmarksPolicyHandler(chrome_schema))); |
| 26 } | 26 } |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 #if defined(ENABLE_EXTENSIONS) | 29 #if defined(ENABLE_EXTENSIONS) |
| 30 TEST_F(ManagedBookmarksPolicyHandlerTest, ApplyPolicySettings) { | 30 TEST_F(ManagedBookmarksPolicyHandlerTest, ApplyPolicySettings) { |
| 31 EXPECT_FALSE(store_->GetValue(bookmarks::prefs::kManagedBookmarks, NULL)); | 31 EXPECT_FALSE(store_->GetValue(bookmarks::prefs::kManagedBookmarks, NULL)); |
| 32 | 32 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 extensions::ListBuilder() | 193 extensions::ListBuilder() |
| 194 .Append(extensions::DictionaryBuilder() | 194 .Append(extensions::DictionaryBuilder() |
| 195 .Set("name", "Google") | 195 .Set("name", "Google") |
| 196 .Set("url", "http://google.com/")) | 196 .Set("url", "http://google.com/")) |
| 197 .Build()); | 197 .Build()); |
| 198 EXPECT_TRUE(pref_value->Equals(expected.get())); | 198 EXPECT_TRUE(pref_value->Equals(expected.get())); |
| 199 } | 199 } |
| 200 #endif | 200 #endif |
| 201 | 201 |
| 202 } // namespace policy | 202 } // namespace policy |
| OLD | NEW |