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

Side by Side Diff: components/policy/core/common/policy_loader_ios_unittest.mm

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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
OLDNEW
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
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),
bartfab (slow) 2015/09/14 14:42:27 Nit: #include "components/policy/core/common/polic
fhorschig 2015/09/16 13:52:05 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698