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

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

Issue 23868021: Prepare ExternalPolicyDataUpdater and ResourceCache for blocking pool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-uploading due to rietveld flake. Created 7 years, 3 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 | Annotate | Revision Log
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/policy/cloud/cloud_external_data_manager_base.h" 5 #include "chrome/browser/policy/cloud/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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 DISALLOW_COPY_AND_ASSIGN(CouldExternalDataManagerBaseTest); 138 DISALLOW_COPY_AND_ASSIGN(CouldExternalDataManagerBaseTest);
139 }; 139 };
140 140
141 CouldExternalDataManagerBaseTest::CouldExternalDataManagerBaseTest() 141 CouldExternalDataManagerBaseTest::CouldExternalDataManagerBaseTest()
142 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) { 142 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {
143 } 143 }
144 144
145 void CouldExternalDataManagerBaseTest::SetUp() { 145 void CouldExternalDataManagerBaseTest::SetUp() {
146 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 146 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
147 resource_cache_.reset(new ResourceCache(temp_dir_.path())); 147 resource_cache_.reset(new ResourceCache(temp_dir_.path(),
148 base::MessageLoopProxy::current()));
148 SetUpExternalDataManager(); 149 SetUpExternalDataManager();
149 150
150 // Set |kStringPolicy| to a string value. 151 // Set |kStringPolicy| to a string value.
151 cloud_policy_store_.policy_map_.Set(kStringPolicy, 152 cloud_policy_store_.policy_map_.Set(kStringPolicy,
152 POLICY_LEVEL_MANDATORY, 153 POLICY_LEVEL_MANDATORY,
153 POLICY_SCOPE_USER, 154 POLICY_SCOPE_USER,
154 new base::StringValue(std::string()), 155 new base::StringValue(std::string()),
155 NULL); 156 NULL);
156 // Make |k10BytePolicy| reference 10 bytes of external data. 157 // Make |k10BytePolicy| reference 10 bytes of external data.
157 SetExternalDataReference( 158 SetExternalDataReference(
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 ConstructMetadata(k20BytePolicyURL, base::SHA1HashString(k10ByteData))); 695 ConstructMetadata(k20BytePolicyURL, base::SHA1HashString(k10ByteData)));
695 cloud_policy_store_.NotifyStoreLoaded(); 696 cloud_policy_store_.NotifyStoreLoaded();
696 base::RunLoop().RunUntilIdle(); 697 base::RunLoop().RunUntilIdle();
697 EXPECT_EQ(1u, callback_data_.size()); 698 EXPECT_EQ(1u, callback_data_.size());
698 ASSERT_TRUE(callback_data_[1]); 699 ASSERT_TRUE(callback_data_[1]);
699 EXPECT_EQ(k10ByteData, *callback_data_[1]); 700 EXPECT_EQ(k10ByteData, *callback_data_[1]);
700 ResetCallbackData(); 701 ResetCallbackData();
701 } 702 }
702 703
703 } // namespace policy 704 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698