Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/chromeos/policy/cloud_external_data_manager_base_unittest.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 void CloudExternalDataManagerBaseTest::SetUp() { 152 void CloudExternalDataManagerBaseTest::SetUp() {
153 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 153 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
154 resource_cache_.reset( 154 resource_cache_.reset(
155 new ResourceCache(temp_dir_.GetPath(), message_loop_.task_runner())); 155 new ResourceCache(temp_dir_.GetPath(), message_loop_.task_runner()));
156 SetUpExternalDataManager(); 156 SetUpExternalDataManager();
157 157
158 // Set |kStringPolicy| to a string value. 158 // Set |kStringPolicy| to a string value.
159 cloud_policy_store_.policy_map_.Set( 159 cloud_policy_store_.policy_map_.Set(
160 kStringPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 160 kStringPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
161 POLICY_SOURCE_CLOUD, base::MakeUnique<base::StringValue>(std::string()), 161 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(std::string()),
162 nullptr); 162 nullptr);
163 // Make |k10BytePolicy| reference 10 bytes of external data. 163 // Make |k10BytePolicy| reference 10 bytes of external data.
164 SetExternalDataReference( 164 SetExternalDataReference(
165 k10BytePolicy, 165 k10BytePolicy,
166 ConstructMetadata(k10BytePolicyURL, 166 ConstructMetadata(k10BytePolicyURL,
167 crypto::SHA256HashString(k10ByteData))); 167 crypto::SHA256HashString(k10ByteData)));
168 // Make |k20BytePolicy| reference 20 bytes of external data. 168 // Make |k20BytePolicy| reference 20 bytes of external data.
169 SetExternalDataReference( 169 SetExternalDataReference(
170 k20BytePolicy, 170 k20BytePolicy,
171 ConstructMetadata(k20BytePolicyURL, 171 ConstructMetadata(k20BytePolicyURL,
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 crypto::SHA256HashString(k10ByteData))); 757 crypto::SHA256HashString(k10ByteData)));
758 cloud_policy_store_.NotifyStoreLoaded(); 758 cloud_policy_store_.NotifyStoreLoaded();
759 base::RunLoop().RunUntilIdle(); 759 base::RunLoop().RunUntilIdle();
760 EXPECT_EQ(1u, callback_data_.size()); 760 EXPECT_EQ(1u, callback_data_.size());
761 ASSERT_TRUE(callback_data_[1]); 761 ASSERT_TRUE(callback_data_[1]);
762 EXPECT_EQ(k10ByteData, *callback_data_[1]); 762 EXPECT_EQ(k10ByteData, *callback_data_[1]);
763 ResetCallbackData(); 763 ResetCallbackData();
764 } 764 }
765 765
766 } // namespace policy 766 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698