| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |