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

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

Issue 10827050: Added a timezone policy and pyauto tests for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments. 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 5695 matching lines...) Expand 10 before | Expand all | Expand 10 after
5706 cmd_dict = { 'command': 'GetTimeInfo' } 5706 cmd_dict = { 'command': 'GetTimeInfo' }
5707 if self.GetLoginInfo()['is_logged_in']: 5707 if self.GetLoginInfo()['is_logged_in']:
5708 return self._GetResultFromJSONRequest(cmd_dict, windex=windex) 5708 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
5709 else: 5709 else:
5710 return self._GetResultFromJSONRequest(cmd_dict, windex=None) 5710 return self._GetResultFromJSONRequest(cmd_dict, windex=None)
5711 5711
5712 def SetTimezone(self, timezone): 5712 def SetTimezone(self, timezone):
5713 """Sets the timezone on ChromeOS. A user must be logged in. 5713 """Sets the timezone on ChromeOS. A user must be logged in.
5714 5714
5715 The timezone is the relative path to the timezone file in 5715 The timezone is the relative path to the timezone file in
5716 /usr/share/zoneinfo. For example, /usr/share/zoneinfo/America/Los_Angeles 5716 /usr/share/zoneinfo. For example, /usr/share/zoneinfo/America/Los_Angeles is
5717 is 'America/Los_Angeles'. 5717 'America/Los_Angeles'. For a list of valid timezones see
5718 'chrome/browser/chromeos/system/timezone_settings.cc'.
5718 5719
5719 This method does not return indication of success or failure. 5720 This method does not return indication of success or failure.
5720 If the timezone is invalid, it falls back to UTC/GMT. 5721 If the timezone is it falls back to a valid timezone.
5721 5722
5722 Raises: 5723 Raises:
5723 pyauto_errors.JSONInterfaceError if the automation call returns an error. 5724 pyauto_errors.JSONInterfaceError if the automation call returns an error.
5724 """ 5725 """
5725 cmd_dict = { 5726 cmd_dict = {
5726 'command': 'SetTimezone', 5727 'command': 'SetTimezone',
5727 'timezone': timezone, 5728 'timezone': timezone,
5728 } 5729 }
5729 self._GetResultFromJSONRequest(cmd_dict, windex=None) 5730 self._GetResultFromJSONRequest(cmd_dict, windex=None)
5730 5731
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
6659 successful = result.wasSuccessful() 6660 successful = result.wasSuccessful()
6660 if not successful: 6661 if not successful:
6661 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) 6662 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename)
6662 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ 6663 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \
6663 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) 6664 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL)
6664 sys.exit(not successful) 6665 sys.exit(not successful)
6665 6666
6666 6667
6667 if __name__ == '__main__': 6668 if __name__ == '__main__':
6668 Main() 6669 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