| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <CoreFoundation/CoreFoundation.h> | 5 #include <CoreFoundation/CoreFoundation.h> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/mac/scoped_cftyperef.h" | 8 #include "base/mac/scoped_cftyperef.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace | 215 } // namespace |
| 216 | 216 |
| 217 // Instantiate abstract test case for basic policy reading tests. | 217 // Instantiate abstract test case for basic policy reading tests. |
| 218 INSTANTIATE_TEST_CASE_P( | 218 INSTANTIATE_TEST_CASE_P( |
| 219 PolicyProviderMacTest, | 219 PolicyProviderMacTest, |
| 220 ConfigurationPolicyProviderTest, | 220 ConfigurationPolicyProviderTest, |
| 221 testing::Values(TestHarness::Create)); | 221 testing::Values(TestHarness::Create)); |
| 222 | 222 |
| 223 // TODO(joaodasilva): instantiate Configuration3rdPartyPolicyProviderTest too |
| 224 // once the mac loader supports 3rd party policy. http://crbug.com/108995 |
| 225 |
| 223 // Special test cases for some mac preferences details. | 226 // Special test cases for some mac preferences details. |
| 224 class PolicyLoaderMacTest : public PolicyTestBase { | 227 class PolicyLoaderMacTest : public PolicyTestBase { |
| 225 protected: | 228 protected: |
| 226 PolicyLoaderMacTest() | 229 PolicyLoaderMacTest() |
| 227 : prefs_(new MockPreferences()), | 230 : prefs_(new MockPreferences()), |
| 228 loader_(new PolicyLoaderMac(&test_policy_definitions::kList, prefs_)), | 231 loader_(new PolicyLoaderMac(&test_policy_definitions::kList, prefs_)), |
| 229 provider_(scoped_ptr<AsyncPolicyLoader>(loader_)) {} | 232 provider_(scoped_ptr<AsyncPolicyLoader>(loader_)) {} |
| 230 virtual ~PolicyLoaderMacTest() {} | 233 virtual ~PolicyLoaderMacTest() {} |
| 231 | 234 |
| 232 MockPreferences* prefs_; | 235 MockPreferences* prefs_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 ScopedCFTypeRef<CFPropertyListRef> property(CreatePropertyFromValue(&root)); | 314 ScopedCFTypeRef<CFPropertyListRef> property(CreatePropertyFromValue(&root)); |
| 312 ASSERT_TRUE(property); | 315 ASSERT_TRUE(property); |
| 313 scoped_ptr<base::Value> value( | 316 scoped_ptr<base::Value> value( |
| 314 PolicyLoaderMac::CreateValueFromProperty(property)); | 317 PolicyLoaderMac::CreateValueFromProperty(property)); |
| 315 ASSERT_TRUE(value.get()); | 318 ASSERT_TRUE(value.get()); |
| 316 | 319 |
| 317 EXPECT_TRUE(root.Equals(value.get())); | 320 EXPECT_TRUE(root.Equals(value.get())); |
| 318 } | 321 } |
| 319 | 322 |
| 320 } // namespace policy | 323 } // namespace policy |
| OLD | NEW |