| 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/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void AddPolicies(NSDictionary* policy); | 61 void AddPolicies(NSDictionary* policy); |
| 62 void AddChromePolicy(NSDictionary* policy); | 62 void AddChromePolicy(NSDictionary* policy); |
| 63 void AddEncodedChromePolicy(NSDictionary* policy); | 63 void AddEncodedChromePolicy(NSDictionary* policy); |
| 64 | 64 |
| 65 bool use_encoded_key_; | 65 bool use_encoded_key_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(TestHarness); | 67 DISALLOW_COPY_AND_ASSIGN(TestHarness); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 TestHarness::TestHarness(bool use_encoded_key) | 70 TestHarness::TestHarness(bool use_encoded_key) |
| 71 : PolicyProviderTestHarness(POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE), | 71 : PolicyProviderTestHarness(POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, |
| 72 POLICY_SOURCE_PLATFORM), |
| 72 use_encoded_key_(use_encoded_key) {} | 73 use_encoded_key_(use_encoded_key) {} |
| 73 | 74 |
| 74 TestHarness::~TestHarness() { | 75 TestHarness::~TestHarness() { |
| 75 // Cleanup any policies left from the test. | 76 // Cleanup any policies left from the test. |
| 76 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kConfigurationKey]; | 77 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kConfigurationKey]; |
| 77 } | 78 } |
| 78 | 79 |
| 79 void TestHarness::SetUp() { | 80 void TestHarness::SetUp() { |
| 80 // Make sure there is no pre-existing policy present. | 81 // Make sure there is no pre-existing policy present. |
| 81 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kConfigurationKey]; | 82 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kConfigurationKey]; |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 258 |
| 258 scoped_refptr<base::TestSimpleTaskRunner> taskRunner = | 259 scoped_refptr<base::TestSimpleTaskRunner> taskRunner = |
| 259 new base::TestSimpleTaskRunner(); | 260 new base::TestSimpleTaskRunner(); |
| 260 PolicyLoaderIOS loader(taskRunner); | 261 PolicyLoaderIOS loader(taskRunner); |
| 261 scoped_ptr<PolicyBundle> bundle = loader.Load(); | 262 scoped_ptr<PolicyBundle> bundle = loader.Load(); |
| 262 ASSERT_TRUE(bundle); | 263 ASSERT_TRUE(bundle); |
| 263 EXPECT_TRUE(bundle->Equals(expected)); | 264 EXPECT_TRUE(bundle->Equals(expected)); |
| 264 } | 265 } |
| 265 | 266 |
| 266 } // namespace policy | 267 } // namespace policy |
| OLD | NEW |