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 "chrome/browser/chromeos/policy/cloud_external_data_manager_base.h" | 5 #include "chrome/browser/chromeos/policy/cloud_external_data_manager_base.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 private: | 146 private: |
147 DISALLOW_COPY_AND_ASSIGN(CloudExternalDataManagerBaseTest); | 147 DISALLOW_COPY_AND_ASSIGN(CloudExternalDataManagerBaseTest); |
148 }; | 148 }; |
149 | 149 |
150 CloudExternalDataManagerBaseTest::CloudExternalDataManagerBaseTest() { | 150 CloudExternalDataManagerBaseTest::CloudExternalDataManagerBaseTest() { |
151 } | 151 } |
152 | 152 |
153 void CloudExternalDataManagerBaseTest::SetUp() { | 153 void CloudExternalDataManagerBaseTest::SetUp() { |
154 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 154 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
155 resource_cache_.reset( | 155 resource_cache_.reset( |
156 new ResourceCache(temp_dir_.path(), message_loop_.task_runner())); | 156 new ResourceCache(temp_dir_.GetPath(), message_loop_.task_runner())); |
157 SetUpExternalDataManager(); | 157 SetUpExternalDataManager(); |
158 | 158 |
159 // Set |kStringPolicy| to a string value. | 159 // Set |kStringPolicy| to a string value. |
160 cloud_policy_store_.policy_map_.Set( | 160 cloud_policy_store_.policy_map_.Set( |
161 kStringPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 161 kStringPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
162 POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(std::string()), | 162 POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(std::string()), |
163 nullptr); | 163 nullptr); |
164 // Make |k10BytePolicy| reference 10 bytes of external data. | 164 // Make |k10BytePolicy| reference 10 bytes of external data. |
165 SetExternalDataReference( | 165 SetExternalDataReference( |
166 k10BytePolicy, | 166 k10BytePolicy, |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 crypto::SHA256HashString(k10ByteData))); | 759 crypto::SHA256HashString(k10ByteData))); |
760 cloud_policy_store_.NotifyStoreLoaded(); | 760 cloud_policy_store_.NotifyStoreLoaded(); |
761 base::RunLoop().RunUntilIdle(); | 761 base::RunLoop().RunUntilIdle(); |
762 EXPECT_EQ(1u, callback_data_.size()); | 762 EXPECT_EQ(1u, callback_data_.size()); |
763 ASSERT_TRUE(callback_data_[1]); | 763 ASSERT_TRUE(callback_data_[1]); |
764 EXPECT_EQ(k10ByteData, *callback_data_[1]); | 764 EXPECT_EQ(k10ByteData, *callback_data_[1]); |
765 ResetCallbackData(); | 765 ResetCallbackData(); |
766 } | 766 } |
767 | 767 |
768 } // namespace policy | 768 } // namespace policy |
OLD | NEW |