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

Unified 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: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/pyautolib/pyauto.py
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index dfe25d69bf43b129f724881405d67290df00a2aa..2b557add04f519161622de3d4f91896f719c988a 100755
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -5406,11 +5406,12 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
"""Sets the timezone on ChromeOS. A user must be logged in.
The timezone is the relative path to the timezone file in
- /usr/share/zoneinfo. For example, /usr/share/zoneinfo/America/Los_Angeles
- is 'America/Los_Angeles'.
+ /usr/share/zoneinfo. For example, /usr/share/zoneinfo/America/Los_Angeles is
+ 'America/Los_Angeles'. For a list of valid timezones see
+ 'chrome/browser/chromeos/system/timezone_settings.cc'.
This method does not return indication of success or failure.
- If the timezone is invalid, it falls back to UTC/GMT.
+ If the timezone is it falls back to a valid timezone.
Raises:
pyauto_errors.JSONInterfaceError if the automation call returns an error.
@@ -5619,6 +5620,25 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
cmd_dict = { 'command': 'CaptureProfilePhoto' }
return self._GetResultFromJSONRequest(cmd_dict)
+ def SetCrosSetting(self, path, value):
+ """Set CrosSetting for the given path to the given value.
+
+ CrosSettings are not handled by PrefService but by the class
+ chromeos::CrosSettings. Therefore, we need this separate function besides
+ SetPrefs.
+
+ Args:
+ path: the path the preference key that needs to be changed
+ example: "cros.system.timezone"
+ value: the value to be set.
+ """
+ cmd_dict = {
+ 'command': 'SetCrosSetting',
+ 'path': path,
+ 'value': value,
+ }
+ self._GetResultFromJSONRequest(cmd_dict, windex=None)
+
def GetMemoryStatsChromeOS(self, duration):
"""Identifies and returns different kinds of current memory usage stats.
« chrome/test/functional/chromeos_time.py ('K') | « 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