diff options
author | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 20:09:52 +0000 |
---|---|---|
committer | nirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 20:09:52 +0000 |
commit | f815828e98b8449e52963f5b50e95d9cd6ed84c0 (patch) | |
tree | 2f1026fbbc63ab9ce2c75554b64293894f0f9bd2 /chrome/test/pyautolib | |
parent | cc9a9a88d5da672b09285ead7e604b6d7b77fd3d (diff) | |
download | chromium_src-f815828e98b8449e52963f5b50e95d9cd6ed84c0.zip chromium_src-f815828e98b8449e52963f5b50e95d9cd6ed84c0.tar.gz chromium_src-f815828e98b8449e52963f5b50e95d9cd6ed84c0.tar.bz2 |
New automation hooks to get/set the thumbnail/menu modes for NTP sections.
A few sample PyAuto tests are included that exerise these new hooks.
Contributed by dennisjeffrey@chromium.org.
BUG=64271
TEST=None
Review URL: http://codereview.chromium.org/6610021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r-- | chrome/test/pyautolib/pyauto.py | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py index 0224c8f..05f219c 100644 --- a/chrome/test/pyautolib/pyauto.py +++ b/chrome/test/pyautolib/pyauto.py @@ -2159,6 +2159,110 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase): } return self._GetResultFromJSONRequest(cmd_dict) + def GetNTPThumbnailMode(self): + """Identifies whether or not each relevant NTP section is in thumbnail mode. + + Thumbnail mode applies to the Apps section and the Most Visited section. + When in thumbnail mode, large thumbnails appear for each item in the + section. When not in thumbnail mode, small icons appear instead. At any + given time, at most one section can be in thumbnail mode in the NTP. + + SAMPLE OUTPUT: + { + u'apps': True, + u'most_visited': False + } + + Returns: + A dictionary indicating whether or not each relevant section of the NTP + is in thumbnail mode. + + Raises: + pyauto_errors.JSONInterfaceError if the automation call returns an error. + """ + cmd_dict = { + 'command': 'GetNTPThumbnailMode', + } + return self._GetResultFromJSONRequest(cmd_dict) + + def SetNTPThumbnailMode(self, section, turn_on): + """Puts or removes a section of the NTP into/from thumbnail (expanded) mode. + + Thumbnail mode applies to the Apps section and the Most Visited section. + At any given time, at most one section can be in thumbnail mode in the NTP; + when a specified section is put into thumbnail mode, the other section is + removed from thumbnail mode. + + Args: + section: A string representing the NTP section to use. + Possible values: + 'apps': the "Apps" section. + 'most_visited': the "Most Visited" section. + turn_on: A boolean indicating whether to put the section into thumbnail + mode (True), or remove the section from thumbnail mode (False). + + Raises: + pyauto_errors.JSONInterfaceError if the automation call returns an error. + """ + cmd_dict = { + 'command': 'SetNTPThumbnailMode', + 'section': section, + 'turn_on': turn_on + } + return self._GetResultFromJSONRequest(cmd_dict) + + def GetNTPMenuMode(self): + """Identifies whether or not each relevant NTP section is in menu mode. + + Menu mode applies to the Apps section, the Most Visited section, and the + Recently Closed section. When in menu mode, the section is almost + completely hidden, appearing as a menu at the bottom of the NTP. When not + in menu mode, the section appears with all information in the regular + location in the NTP. + + SAMPLE OUTPUT: + { + u'apps': False, + u'most_visited': True, + u'recently_closed': True + } + + Returns: + A dictionary indicating whether or not each relevant section of the NTP + is in menu mode. + + Raises: + pyauto_errors.JSONInterfaceError if the automation call returns an error. + """ + cmd_dict = { + 'command': 'GetNTPMenuMode', + } + return self._GetResultFromJSONRequest(cmd_dict) + + def SetNTPMenuMode(self, section, turn_on): + """Puts or removes the specified section of the NTP into/from menu mode. + + Menu mode applies to the Apps section, the Most Visited section, and the + Recently Closed section. + + Args: + section: A string representing the NTP section to use. + Possible values: + 'apps': the "Apps" section. + 'most_visited': the "Most Visited" section. + 'recently_closed': the "Recently Closed" section. + turn_on: A boolean indicating whether to put the section into menu mode + (True), or remove the section from menu mode (False). + + Raises: + pyauto_errors.JSONInterfaceError if the automation call returns an error. + """ + cmd_dict = { + 'command': 'SetNTPMenuMode', + 'section': section, + 'turn_on': turn_on + } + return self._GetResultFromJSONRequest(cmd_dict) ## ChromeOS section |