OLD | NEW |
1 #!/usr/bin/python | |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # 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 |
4 # found in the LICENSE file. | 3 # found in the LICENSE file. |
5 | 4 |
6 """Base class for tests that need to update the policies enforced by Chrome. | 5 """Base class for tests that need to update the policies enforced by Chrome. |
7 | 6 |
8 Subclasses can call SetUserPolicy (ChromeOS, Linux, Windows) and | 7 Subclasses can call SetUserPolicy (ChromeOS, Linux, Windows) and |
9 SetDevicePolicy (ChromeOS only) with a dictionary of the policies to install. | 8 SetDevicePolicy (ChromeOS only) with a dictionary of the policies to install. |
10 | 9 |
11 The current implementation depends on the platform. The implementations might | 10 The current implementation depends on the platform. The implementations might |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 361 |
363 def SetDevicePolicy(self, device_policy=None, owner=None): | 362 def SetDevicePolicy(self, device_policy=None, owner=None): |
364 """Sets the device policy provided as a dict and the owner on ChromeOS. | 363 """Sets the device policy provided as a dict and the owner on ChromeOS. |
365 | 364 |
366 Passing a value of None as the device policy clears it.""" | 365 Passing a value of None as the device policy clears it.""" |
367 if not self.IsChromeOS(): | 366 if not self.IsChromeOS(): |
368 raise NotImplementedError('Device policy is only available on ChromeOS.') | 367 raise NotImplementedError('Device policy is only available on ChromeOS.') |
369 | 368 |
370 self._GenerateDevicePolicyBlob(device_policy, owner) | 369 self._GenerateDevicePolicyBlob(device_policy, owner) |
371 self._RefreshDevicePolicy() | 370 self._RefreshDevicePolicy() |
OLD | NEW |