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

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

Issue 44083005: policy: Remove UserCloudPolicyManagerFactory's dependency on Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 1 month 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 void UserCloudExternalDataManagerTest::SetExternalDataReference( 86 void UserCloudExternalDataManagerTest::SetExternalDataReference(
87 const std::string& policy, 87 const std::string& policy,
88 scoped_ptr<base::DictionaryValue> metadata) { 88 scoped_ptr<base::DictionaryValue> metadata) {
89 #if defined(OS_CHROMEOS) 89 #if defined(OS_CHROMEOS)
90 UserCloudPolicyManagerChromeOS* policy_manager = 90 UserCloudPolicyManagerChromeOS* policy_manager =
91 UserCloudPolicyManagerFactoryChromeOS::GetForProfile( 91 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(
92 browser()->profile()); 92 browser()->profile());
93 #else 93 #else
94 UserCloudPolicyManager* policy_manager = 94 UserCloudPolicyManager* policy_manager =
95 UserCloudPolicyManagerFactory::GetForProfile(browser()->profile()); 95 UserCloudPolicyManagerFactory::GetForBrowserContext(browser()->profile());
96 #endif 96 #endif
97 ASSERT_TRUE(policy_manager); 97 ASSERT_TRUE(policy_manager);
98 CloudPolicyStore* store = policy_manager->core()->store(); 98 CloudPolicyStore* store = policy_manager->core()->store();
99 ASSERT_TRUE(store); 99 ASSERT_TRUE(store);
100 PolicyMap policy_map; 100 PolicyMap policy_map;
101 policy_map.Set(policy, 101 policy_map.Set(policy,
102 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 102 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
103 metadata.release(), 103 metadata.release(),
104 new ExternalDataFetcher(store->external_data_manager(), 104 new ExternalDataFetcher(store->external_data_manager(),
105 policy)); 105 policy));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 &ExternalDataFetchCallback, 146 &ExternalDataFetchCallback,
147 &fetched_external_data, 147 &fetched_external_data,
148 run_loop.QuitClosure())); 148 run_loop.QuitClosure()));
149 run_loop.Run(); 149 run_loop.Run();
150 150
151 ASSERT_TRUE(fetched_external_data); 151 ASSERT_TRUE(fetched_external_data);
152 EXPECT_EQ(external_data, *fetched_external_data); 152 EXPECT_EQ(external_data, *fetched_external_data);
153 } 153 }
154 154
155 } // namespace policy 155 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698