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

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/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 ASSERT_FALSE(external_data.empty()); 57 ASSERT_FALSE(external_data.empty());
58 58
59 scoped_ptr<base::DictionaryValue> metadata = 59 scoped_ptr<base::DictionaryValue> metadata =
60 test::ConstructExternalDataReference(url.spec(), external_data); 60 test::ConstructExternalDataReference(url.spec(), external_data);
61 #if defined(OS_CHROMEOS) 61 #if defined(OS_CHROMEOS)
62 UserCloudPolicyManagerChromeOS* policy_manager = 62 UserCloudPolicyManagerChromeOS* policy_manager =
63 UserCloudPolicyManagerFactoryChromeOS::GetForProfile( 63 UserCloudPolicyManagerFactoryChromeOS::GetForProfile(
64 browser()->profile()); 64 browser()->profile());
65 #else 65 #else
66 UserCloudPolicyManager* policy_manager = 66 UserCloudPolicyManager* policy_manager =
67 UserCloudPolicyManagerFactory::GetForProfile(browser()->profile()); 67 UserCloudPolicyManagerFactory::GetForBrowserContext(browser()->profile());
68 #endif 68 #endif
69 ASSERT_TRUE(policy_manager); 69 ASSERT_TRUE(policy_manager);
70 // TODO(bartfab): The test injects an ExternalDataFetcher for an arbitrary 70 // TODO(bartfab): The test injects an ExternalDataFetcher for an arbitrary
71 // policy. This is only done because there are no policies that reference 71 // policy. This is only done because there are no policies that reference
72 // external data yet. Once the first such policy is added, switch the test to 72 // external data yet. Once the first such policy is added, switch the test to
73 // that policy and stop injecting a manually instantiated ExternalDataFetcher. 73 // that policy and stop injecting a manually instantiated ExternalDataFetcher.
74 test::SetExternalDataReference(policy_manager->core(), 74 test::SetExternalDataReference(policy_manager->core(),
75 key::kHomepageLocation, 75 key::kHomepageLocation,
76 make_scoped_ptr(metadata->DeepCopy())); 76 make_scoped_ptr(metadata->DeepCopy()));
77 content::RunAllPendingInMessageLoop(); 77 content::RunAllPendingInMessageLoop();
(...skipping 14 matching lines...) Expand all
92 &test::ExternalDataFetchCallback, 92 &test::ExternalDataFetchCallback,
93 &fetched_external_data, 93 &fetched_external_data,
94 run_loop.QuitClosure())); 94 run_loop.QuitClosure()));
95 run_loop.Run(); 95 run_loop.Run();
96 96
97 ASSERT_TRUE(fetched_external_data); 97 ASSERT_TRUE(fetched_external_data);
98 EXPECT_EQ(external_data, *fetched_external_data); 98 EXPECT_EQ(external_data, *fetched_external_data);
99 } 99 }
100 100
101 } // namespace policy 101 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/android/signin/signin_manager_android.cc ('k') | chrome/browser/policy/cloud/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698