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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/downloads.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto_utils.py
diff --git a/chrome/test/pyautolib/pyauto_utils.py b/chrome/test/pyautolib/pyauto_utils.py
index 4d3a3d1f5f14d31a51fb21639a85982ee6579b3f..bd0945ce1523c871d2e96d5c9e3a702daa2b26c9 100644
--- a/chrome/test/pyautolib/pyauto_utils.py
+++ b/chrome/test/pyautolib/pyauto_utils.py
@@ -77,3 +77,12 @@ class ExistingPathReplacer(object):
def _RemoveBackupDir(self):
if self._backup_dir and os.path.isdir(self._backup_dir):
shutil.rmtree(self._backup_dir, ignore_errors=True)
+
+
+def RemovePath(path):
+ """Remove the given path (file or dir)."""
+ if os.path.isdir(path):
+ shutil.rmtree(path, ignore_errors=True)
+ return
+ os.remove(path)
+
« 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