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

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

Issue 7523063: Add a hook for capturing a user profile photo and saving it to file and local state. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressed all the comments Created 9 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """PyAuto: Python Interface to Chromium's Automation Proxy. 7 """PyAuto: Python Interface to Chromium's Automation Proxy.
8 8
9 PyAuto uses swig to expose Automation Proxy interfaces to Python. 9 PyAuto uses swig to expose Automation Proxy interfaces to Python.
10 For complete documentation on the functionality available, 10 For complete documentation on the functionality available,
(...skipping 3589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3600 Raises: 3600 Raises:
3601 pyauto_errors.JSONInterfaceError if the automation call returns an error. 3601 pyauto_errors.JSONInterfaceError if the automation call returns an error.
3602 """ 3602 """
3603 cmd_dict = { 'command': 'SetMute' } 3603 cmd_dict = { 'command': 'SetMute' }
3604 cmd_dict = { 3604 cmd_dict = {
3605 'command': 'SetMute', 3605 'command': 'SetMute',
3606 'mute': mute, 3606 'mute': mute,
3607 } 3607 }
3608 return self._GetResultFromJSONRequest(cmd_dict, windex=-1) 3608 return self._GetResultFromJSONRequest(cmd_dict, windex=-1)
3609 3609
3610 def CaptureProfilePhoto(self):
3611 """Captures user profile photo.
Nirnimesh 2011/07/30 10:32:31 Append: on chromeos.
frankf 2011/08/01 19:31:09 Done.
3612
3613 This is done by driving the UI. The profile photo is saved in a file
Nirnimesh 2011/07/30 10:32:31 which UI. be specific. Prefs profile photo capture
frankf 2011/08/01 19:31:09 Done.
3614 and its path is set in the local state.
Nirnimesh 2011/07/30 10:32:31 append: preferences
frankf 2011/08/01 19:31:09 Done.
3615
Nirnimesh 2011/07/30 10:32:31 Should the user be logged in? mention it so
frankf 2011/08/01 19:31:09 Done.
3616 Raises:
3617 pyauto_errors.JSONInterfaceError if the automation call returns an error.
3618 """
3619 cmd_dict = { 'command': 'CaptureProfilePhoto' }
3620 return self._GetResultFromJSONRequest(cmd_dict)
3621
3610 ## ChromeOS section -- end 3622 ## ChromeOS section -- end
3611 3623
3612 3624
3613 class _RemoteProxy(): 3625 class _RemoteProxy():
3614 """Class for PyAuto remote method calls. 3626 """Class for PyAuto remote method calls.
3615 3627
3616 Use this class along with RemoteHost.testRemoteHost to establish a PyAuto 3628 Use this class along with RemoteHost.testRemoteHost to establish a PyAuto
3617 connection with another machine and make remote PyAuto calls. The RemoteProxy 3629 connection with another machine and make remote PyAuto calls. The RemoteProxy
3618 mimics a PyAuto object, so all json-style PyAuto calls can be made on it. 3630 mimics a PyAuto object, so all json-style PyAuto calls can be made on it.
3619 3631
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
4118 successful = result.wasSuccessful() 4130 successful = result.wasSuccessful()
4119 if not successful: 4131 if not successful:
4120 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) 4132 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename)
4121 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ 4133 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \
4122 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) 4134 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL)
4123 sys.exit(not successful) 4135 sys.exit(not successful)
4124 4136
4125 4137
4126 if __name__ == '__main__': 4138 if __name__ == '__main__':
4127 Main() 4139 Main()
OLDNEW
« chrome/test/functional/chromeos_prefs.py ('K') | « chrome/test/functional/chromeos_prefs.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698