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

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

Issue 8102019: redesign and reimplement proxy config service and tracker, revise proxy ui on cros (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3614 PROXY_TYPE_DIRECT = 1 3614 PROXY_TYPE_DIRECT = 1
3615 PROXY_TYPE_MANUAL = 2 3615 PROXY_TYPE_MANUAL = 2
3616 PROXY_TYPE_PAC = 3 3616 PROXY_TYPE_PAC = 3
3617 3617
3618 def GetProxyTypeName(self, proxy_type): 3618 def GetProxyTypeName(self, proxy_type):
3619 values = { self.PROXY_TYPE_DIRECT: 'Direct Internet connection', 3619 values = { self.PROXY_TYPE_DIRECT: 'Direct Internet connection',
3620 self.PROXY_TYPE_MANUAL: 'Manual proxy configuration', 3620 self.PROXY_TYPE_MANUAL: 'Manual proxy configuration',
3621 self.PROXY_TYPE_PAC: 'Automatic proxy configuration' } 3621 self.PROXY_TYPE_PAC: 'Automatic proxy configuration' }
3622 return values[proxy_type] 3622 return values[proxy_type]
3623 3623
3624 def GetProxySettingsOnChromeOS(self): 3624 def GetProxySettingsOnChromeOS(self, windex=0):
3625 """Get current proxy settings on Chrome OS. 3625 """Get current proxy settings on Chrome OS.
3626 3626
3627 Returns: 3627 Returns:
3628 A dictionary. See SetProxySettings() below 3628 A dictionary. See SetProxySettings() below
3629 for the full list of possible dictionary keys. 3629 for the full list of possible dictionary keys.
3630 3630
3631 Samples: 3631 Samples:
3632 { u'ignorelist': [], 3632 { u'ignorelist': [],
3633 u'single': False, 3633 u'single': False,
3634 u'type': 1} 3634 u'type': 1}
3635 3635
3636 { u'ignorelist': [u'www.example.com', u'www.example2.com'], 3636 { u'ignorelist': [u'www.example.com', u'www.example2.com'],
3637 u'single': True, 3637 u'single': True,
3638 u'singlehttp': u'24.27.78.152', 3638 u'singlehttp': u'24.27.78.152',
3639 u'singlehttpport': 1728, 3639 u'singlehttpport': 1728,
3640 u'type': 2} 3640 u'type': 2}
3641 3641
3642 { u'ignorelist': [], 3642 { u'ignorelist': [],
3643 u'pacurl': u'http://example.com/config.pac', 3643 u'pacurl': u'http://example.com/config.pac',
3644 u'single': False, 3644 u'single': False,
3645 u'type': 3} 3645 u'type': 3}
3646 3646
3647 Raises: 3647 Raises:
3648 pyauto_errors.JSONInterfaceError if the automation call returns an error. 3648 pyauto_errors.JSONInterfaceError if the automation call returns an error.
3649 """ 3649 """
3650 cmd_dict = { 'command': 'GetProxySettings' } 3650 cmd_dict = { 'command': 'GetProxySettings' }
3651 return self._GetResultFromJSONRequest(cmd_dict, windex=-1) 3651 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3652 3652
3653 def SetProxySettingsOnChromeOS(self, key, value): 3653 def SetProxySettingsOnChromeOS(self, key, value, windex=0):
3654 """Set a proxy setting on Chrome OS. 3654 """Set a proxy setting on Chrome OS.
3655 3655
3656 Owner must be logged in for these to persist. 3656 Owner must be logged in for these to persist.
3657 If user is not logged in or is logged in as non-owner or guest, 3657 If user is not logged in or is logged in as non-owner or guest,
3658 proxy settings do not persist across browser restarts or login/logout. 3658 proxy settings do not persist across browser restarts or login/logout.
3659 3659
3660 Valid settings are: 3660 Valid settings are:
3661 'type': int - Type of proxy. Should be one of: 3661 'type': int - Type of proxy. Should be one of:
3662 PROXY_TYPE_DIRECT, PROXY_TYPE_MANUAL, PROXY_TYPE_PAC. 3662 PROXY_TYPE_DIRECT, PROXY_TYPE_MANUAL, PROXY_TYPE_PAC.
3663 'ignorelist': list - The list of hosts and domains to ignore. 3663 'ignorelist': list - The list of hosts and domains to ignore.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3695 self.SetProxySettings('pacurl', 'http://example.com/config.pac') 3695 self.SetProxySettings('pacurl', 'http://example.com/config.pac')
3696 3696
3697 Raises: 3697 Raises:
3698 pyauto_errors.JSONInterfaceError if the automation call returns an error. 3698 pyauto_errors.JSONInterfaceError if the automation call returns an error.
3699 """ 3699 """
3700 cmd_dict = { 3700 cmd_dict = {
3701 'command': 'SetProxySettings', 3701 'command': 'SetProxySettings',
3702 'key': key, 3702 'key': key,
3703 'value': value, 3703 'value': value,
3704 } 3704 }
3705 return self._GetResultFromJSONRequest(cmd_dict, windex=-1) 3705 return self._GetResultFromJSONRequest(cmd_dict, windex=windex)
3706 3706
3707 def ForgetWifiNetwork(self, service_path): 3707 def ForgetWifiNetwork(self, service_path):
3708 """Forget a remembered network by its service path. 3708 """Forget a remembered network by its service path.
3709 3709
3710 This function is equivalent to clicking the 'Forget Network' button in the 3710 This function is equivalent to clicking the 'Forget Network' button in the
3711 chrome://settings/internet page. This function does not indicate whether 3711 chrome://settings/internet page. This function does not indicate whether
3712 or not forget succeeded or failed. It is up to the caller to call 3712 or not forget succeeded or failed. It is up to the caller to call
3713 GetNetworkInfo to check the updated remembered_wifi list to verify the 3713 GetNetworkInfo to check the updated remembered_wifi list to verify the
3714 service has been removed. 3714 service has been removed.
3715 3715
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
4732 successful = result.wasSuccessful() 4732 successful = result.wasSuccessful()
4733 if not successful: 4733 if not successful:
4734 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) 4734 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename)
4735 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ 4735 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \
4736 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) 4736 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL)
4737 sys.exit(not successful) 4737 sys.exit(not successful)
4738 4738
4739 4739
4740 if __name__ == '__main__': 4740 if __name__ == '__main__':
4741 Main() 4741 Main()
OLDNEW
« chrome/browser/chromeos/proxy_config_service_impl.cc ('K') | « chrome/test/base/testing_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698