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

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 7067033: Add pyauto commands to access local state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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
« chrome/test/pyautolib/prefs_info.py ('K') | « chrome/test/pyautolib/prefs_info.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto.py
===================================================================
--- chrome/test/pyautolib/pyauto.py (revision 86289)
+++ chrome/test/pyautolib/pyauto.py (working copy)
@@ -816,6 +816,51 @@
'action': 'default'}
self._GetResultFromJSONRequest(cmd_dict)
+
+ def GetLocalStatePrefsInfo(self):
+ """Return info about preferences.
+
+ This represents a snapshot of the preferences. If you expect preferences
Nirnimesh 2011/05/24 19:49:02 s/preferences/local state preferences/
Miranda Callahan 2011/05/24 20:42:34 Done.
+ to have changed, you need to call this method again to get a fresh
+ snapshot.
+
+ Returns:
+ an instance of prefs_info.PrefsInfo
+ """
+ return prefs_info.PrefsInfo(
+ self._SendJSONRequest(0,
+ json.dumps({'command': 'GetLocalStatePrefsInfo'}),
+ self.action_max_timeout_ms()))
+
+ def SetLocalState(self, path, value):
Nirnimesh 2011/05/24 19:49:02 How about SetLocalStatePrefs?
Miranda Callahan 2011/05/24 20:42:34 Done.
+ """Set preference for the given path.
Nirnimesh 2011/05/24 19:49:02 s/preference/local state preference/
Miranda Callahan 2011/05/24 20:42:34 Done.
+
+ Preferences are stored by Chromium as a hierarchical dictionary.
+ dot-separated paths can be used to refer to a particular preference.
+ example: "session.restore_on_startup"
+
+ Some preferences are managed, that is, they cannot be changed by the
+ user. It's up to the user to know which ones can be changed. Typically,
+ the options available via Chromium preferences can be changed.
+
+ Args:
+ path: the path the preference key that needs to be changed
+ example: "session.restore_on_startup"
+ One of the equivalent names in chrome/common/pref_names.h could
+ also be used.
+ value: the value to be set. It could be plain values like int, bool,
+ string or complex ones like list.
+ The user has to ensure that the right value is specified for the
+ right key. It's useful to dump the preferences first to determine
+ what type is expected for a particular preference path.
+ """
+ cmd_dict = {
+ 'command': 'SetLocalState',
+ 'path': path,
+ 'value': value,
+ }
+ self._GetResultFromJSONRequest(cmd_dict)
+
def GetPrefsInfo(self):
"""Return info about preferences.
« chrome/test/pyautolib/prefs_info.py ('K') | « chrome/test/pyautolib/prefs_info.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698