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

Side by Side Diff: chrome/test/pyautolib/pyauto.py

Issue 10832222: Added a timezone policy and pyauto tests for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase and update policy id. Created 8 years, 4 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
« no previous file with comments | « chrome/test/functional/policy_test_cases.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """PyAuto: Python Interface to Chromium's Automation Proxy. 6 """PyAuto: Python Interface to Chromium's Automation Proxy.
7 7
8 PyAuto uses swig to expose Automation Proxy interfaces to Python. 8 PyAuto uses swig to expose Automation Proxy interfaces to Python.
9 For complete documentation on the functionality available, 9 For complete documentation on the functionality available,
10 run pydoc on this file. 10 run pydoc on this file.
(...skipping 6018 matching lines...) Expand 10 before | Expand all | Expand 10 after
6029 cmd_dict = { 'command': 'GetTimeInfo' } 6029 cmd_dict = { 'command': 'GetTimeInfo' }
6030 if self.GetLoginInfo()['is_logged_in']: 6030 if self.GetLoginInfo()['is_logged_in']:
6031 return self._GetResultFromJSONRequest(cmd_dict, windex=windex) 6031 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
6032 else: 6032 else:
6033 return self._GetResultFromJSONRequest(cmd_dict, windex=None) 6033 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
6034 6034
6035 def SetTimezone(self, timezone): 6035 def SetTimezone(self, timezone):
6036 """Sets the timezone on ChromeOS. A user must be logged in. 6036 """Sets the timezone on ChromeOS. A user must be logged in.
6037 6037
6038 The timezone is the relative path to the timezone file in 6038 The timezone is the relative path to the timezone file in
6039 /usr/share/zoneinfo. For example, /usr/share/zoneinfo/America/Los_Angeles 6039 /usr/share/zoneinfo. For example, /usr/share/zoneinfo/America/Los_Angeles is
6040 is 'America/Los_Angeles'. 6040 'America/Los_Angeles'. For a list of valid timezones see
6041 'chrome/browser/chromeos/system/timezone_settings.cc'.
6041 6042
6042 This method does not return indication of success or failure. 6043 This method does not return indication of success or failure.
6043 If the timezone is invalid, it falls back to UTC/GMT. 6044 If the timezone is it falls back to a valid timezone.
6044 6045
6045 Raises: 6046 Raises:
6046 pyauto_errors.JSONInterfaceError if the automation call returns an error. 6047 pyauto_errors.JSONInterfaceError if the automation call returns an error.
6047 """ 6048 """
6048 cmd_dict = { 6049 cmd_dict = {
6049 'command': 'SetTimezone', 6050 'command': 'SetTimezone',
6050 'timezone': timezone, 6051 'timezone': timezone,
6051 } 6052 }
6052 self._GetResultFromJSONRequest(cmd_dict, windex=None) 6053 self._GetResultFromJSONRequest(cmd_dict, windex=None)
6053 6054
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
6982 successful = result.wasSuccessful() 6983 successful = result.wasSuccessful()
6983 if not successful: 6984 if not successful:
6984 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) 6985 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename)
6985 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ 6986 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \
6986 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) 6987 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL)
6987 sys.exit(not successful) 6988 sys.exit(not successful)
6988 6989
6989 6990
6990 if __name__ == '__main__': 6991 if __name__ == '__main__':
6991 Main() 6992 Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/policy_test_cases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698