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

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

Issue 3141039: Cleanup in downloads tests (Closed)
Patch Set: . Created 10 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
« no previous file with comments | « chrome/test/functional/downloads.py ('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/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2010 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 """Utilities for PyAuto.""" 7 """Utilities for PyAuto."""
8 8
9 import logging 9 import logging
10 import os 10 import os
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 def _CleanupRequestedPath(self): 70 def _CleanupRequestedPath(self):
71 if os.path.exists(self._path): 71 if os.path.exists(self._path):
72 if os.path.isdir(self._path): 72 if os.path.isdir(self._path):
73 shutil.rmtree(self._path, ignore_errors=True) 73 shutil.rmtree(self._path, ignore_errors=True)
74 else: 74 else:
75 os.remove(self._path) 75 os.remove(self._path)
76 76
77 def _RemoveBackupDir(self): 77 def _RemoveBackupDir(self):
78 if self._backup_dir and os.path.isdir(self._backup_dir): 78 if self._backup_dir and os.path.isdir(self._backup_dir):
79 shutil.rmtree(self._backup_dir, ignore_errors=True) 79 shutil.rmtree(self._backup_dir, ignore_errors=True)
80
81
82 def RemovePath(path):
83 """Remove the given path (file or dir)."""
84 if os.path.isdir(path):
85 shutil.rmtree(path, ignore_errors=True)
86 return
87 os.remove(path)
88
OLDNEW
« no previous file with comments | « chrome/test/functional/downloads.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698