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

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

Issue 10806034: Ability to clear old history 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/options2/clear_browser_data_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """PyAuto: Python Interface to Chromium's Automation Proxy. 6 """PyAuto: Python Interface to Chromium's Automation Proxy.
7 7
8 PyAuto uses swig to expose Automation Proxy interfaces to Python. 8 PyAuto uses swig to expose Automation Proxy interfaces to Python.
9 For complete documentation on the functionality available, 9 For complete documentation on the functionality available,
10 run pydoc on this file. 10 run pydoc on this file.
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 def ClearBrowsingData(self, to_remove, time_period): 2652 def ClearBrowsingData(self, to_remove, time_period):
2653 """Clear the specified browsing data. Implements the features available in 2653 """Clear the specified browsing data. Implements the features available in
2654 the "ClearBrowsingData" UI. 2654 the "ClearBrowsingData" UI.
2655 2655
2656 Args: 2656 Args:
2657 to_remove: a list of strings indicating which types of browsing data 2657 to_remove: a list of strings indicating which types of browsing data
2658 should be removed. Strings that can be in the list are: 2658 should be removed. Strings that can be in the list are:
2659 HISTORY, DOWNLOADS, COOKIES, PASSWORDS, FORM_DATA, CACHE 2659 HISTORY, DOWNLOADS, COOKIES, PASSWORDS, FORM_DATA, CACHE
2660 time_period: a string indicating the time period for the removal. 2660 time_period: a string indicating the time period for the removal.
2661 Possible strings are: 2661 Possible strings are:
2662 LAST_HOUR, LAST_DAY, LAST_WEEK, FOUR_WEEKS, EVERYTHING 2662 LAST_HOUR, LAST_DAY, LAST_WEEK, FOUR_WEEKS,
2663 EXCEPT_LAST_HOUR, EXCEPT_LAST_DAY, EXCEPT_LAST_WEEK,
2664 EXCEPT_FOUR_WEEKS, EVERYTHING
2663 2665
2664 Raises: 2666 Raises:
2665 pyauto_errors.JSONInterfaceError if the automation call returns an error. 2667 pyauto_errors.JSONInterfaceError if the automation call returns an error.
2666 """ 2668 """
2667 cmd_dict = { # Prepare command for the json interface 2669 cmd_dict = { # Prepare command for the json interface
2668 'command': 'ClearBrowsingData', 2670 'command': 'ClearBrowsingData',
2669 'to_remove': to_remove, 2671 'to_remove': to_remove,
2670 'time_period': time_period 2672 'time_period': time_period
2671 } 2673 }
2672 return self._GetResultFromJSONRequest(cmd_dict) 2674 return self._GetResultFromJSONRequest(cmd_dict)
(...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after
6002 successful = result.wasSuccessful() 6004 successful = result.wasSuccessful()
6003 if not successful: 6005 if not successful:
6004 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename) 6006 pyauto_tests_file = os.path.join(self.TestsDir(), self._tests_filename)
6005 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \ 6007 print >>sys.stderr, 'Tests can be disabled by editing %s. ' \
6006 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL) 6008 'Ref: %s' % (pyauto_tests_file, _PYAUTO_DOC_URL)
6007 sys.exit(not successful) 6009 sys.exit(not successful)
6008 6010
6009 6011
6010 if __name__ == '__main__': 6012 if __name__ == '__main__':
6011 Main() 6013 Main()
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/clear_browser_data_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698