OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "components/policy/core/common/cloud/component_cloud_policy_service.h" | 5 #include "components/policy/core/common/cloud/component_cloud_policy_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 client_(nullptr), | 112 client_(nullptr), |
113 core_(dm_protocol::kChromeUserPolicyType, | 113 core_(dm_protocol::kChromeUserPolicyType, |
114 std::string(), | 114 std::string(), |
115 &store_, | 115 &store_, |
116 loop_.task_runner()) {} | 116 loop_.task_runner()) {} |
117 | 117 |
118 void SetUp() override { | 118 void SetUp() override { |
119 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 119 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
120 | 120 |
121 owned_cache_.reset( | 121 owned_cache_.reset( |
122 new ResourceCache(temp_dir_.path(), loop_.task_runner())); | 122 new ResourceCache(temp_dir_.GetPath(), loop_.task_runner())); |
123 cache_ = owned_cache_.get(); | 123 cache_ = owned_cache_.get(); |
124 | 124 |
125 builder_.policy_data().set_policy_type( | 125 builder_.policy_data().set_policy_type( |
126 dm_protocol::kChromeExtensionPolicyType); | 126 dm_protocol::kChromeExtensionPolicyType); |
127 builder_.policy_data().set_settings_entity_id(kTestExtension); | 127 builder_.policy_data().set_settings_entity_id(kTestExtension); |
128 builder_.payload().set_download_url(kTestDownload); | 128 builder_.payload().set_download_url(kTestDownload); |
129 builder_.payload().set_secure_hash(crypto::SHA256HashString(kTestPolicy)); | 129 builder_.payload().set_secure_hash(crypto::SHA256HashString(kTestPolicy)); |
130 | 130 |
131 expected_policy_.Set( | 131 expected_policy_.Set( |
132 "Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 132 "Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 EXPECT_TRUE(base::ContainsKey(contents, kTestExtension)); | 568 EXPECT_TRUE(base::ContainsKey(contents, kTestExtension)); |
569 EXPECT_FALSE(base::ContainsKey(contents, kTestExtension2)); | 569 EXPECT_FALSE(base::ContainsKey(contents, kTestExtension2)); |
570 | 570 |
571 // And the service isn't publishing policy for the second extension anymore. | 571 // And the service isn't publishing policy for the second extension anymore. |
572 expected_bundle.Clear(); | 572 expected_bundle.Clear(); |
573 expected_bundle.Get(ns).CopyFrom(expected_policy_); | 573 expected_bundle.Get(ns).CopyFrom(expected_policy_); |
574 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); | 574 EXPECT_TRUE(service_->policy().Equals(expected_bundle)); |
575 } | 575 } |
576 | 576 |
577 } // namespace policy | 577 } // namespace policy |
OLD | NEW |