OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <UIKit/UIKit.h> | 5 #include <UIKit/UIKit.h> |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 void TestHarness::SetUp() { | 81 void TestHarness::SetUp() { |
82 // Make sure there is no pre-existing policy present. | 82 // Make sure there is no pre-existing policy present. |
83 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kConfigurationKey]; | 83 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kConfigurationKey]; |
84 } | 84 } |
85 | 85 |
86 ConfigurationPolicyProvider* TestHarness::CreateProvider( | 86 ConfigurationPolicyProvider* TestHarness::CreateProvider( |
87 SchemaRegistry* registry, | 87 SchemaRegistry* registry, |
88 scoped_refptr<base::SequencedTaskRunner> task_runner) { | 88 scoped_refptr<base::SequencedTaskRunner> task_runner) { |
89 scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderIOS(task_runner)); | 89 scoped_ptr<AsyncPolicyLoader> loader(); |
90 return new AsyncPolicyProvider(registry, loader.Pass()); | 90 return new AsyncPolicyProvider( |
| 91 registry, make_scoped_ptr(new PolicyLoaderIOS(task_runner))); |
91 } | 92 } |
92 | 93 |
93 void TestHarness::InstallEmptyPolicy() { | 94 void TestHarness::InstallEmptyPolicy() { |
94 AddPolicies(@{}); | 95 AddPolicies(@{}); |
95 } | 96 } |
96 | 97 |
97 void TestHarness::InstallStringPolicy(const std::string& policy_name, | 98 void TestHarness::InstallStringPolicy(const std::string& policy_name, |
98 const std::string& policy_value) { | 99 const std::string& policy_value) { |
99 NSString* key = base::SysUTF8ToNSString(policy_name); | 100 NSString* key = base::SysUTF8ToNSString(policy_name); |
100 NSString* value = base::SysUTF8ToNSString(policy_value); | 101 NSString* value = base::SysUTF8ToNSString(policy_value); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 262 |
262 scoped_refptr<base::TestSimpleTaskRunner> taskRunner = | 263 scoped_refptr<base::TestSimpleTaskRunner> taskRunner = |
263 new base::TestSimpleTaskRunner(); | 264 new base::TestSimpleTaskRunner(); |
264 PolicyLoaderIOS loader(taskRunner); | 265 PolicyLoaderIOS loader(taskRunner); |
265 scoped_ptr<PolicyBundle> bundle = loader.Load(); | 266 scoped_ptr<PolicyBundle> bundle = loader.Load(); |
266 ASSERT_TRUE(bundle); | 267 ASSERT_TRUE(bundle); |
267 EXPECT_TRUE(bundle->Equals(expected)); | 268 EXPECT_TRUE(bundle->Equals(expected)); |
268 } | 269 } |
269 | 270 |
270 } // namespace policy | 271 } // namespace policy |
OLD | NEW |