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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py

Issue 2896423004: webkitpy: Remove contents of directory. (Closed)
Patch Set: Fixing tests. Created 3 years, 7 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
Index: third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
index e4d94a1e47c81fcc21a729a80d3328faed508370..fd570c98fc384a89df759b846e2cba5a4109a1ac 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -33,8 +33,12 @@ import re
import StringIO
import unittest
+from webkitpy.common.system.filesystem import _remove_contents
+
class MockFileSystem(object):
+ # pylint: disable=unused-argument
+
sep = '/'
pardir = '..'
@@ -386,13 +390,13 @@ class MockFileSystem(object):
return dot_dot + rel_path
- def remove(self, path):
+ def remove(self, path, retry=True):
if self.files[path] is None:
self._raise_not_found(path)
self.files[path] = None
self.written_files[path] = None
- def rmtree(self, path_to_remove):
+ def rmtree(self, path_to_remove, ignore_errors=True, onerror=None):
path_to_remove = self.normpath(path_to_remove)
for file_path in self.files:
@@ -406,6 +410,9 @@ class MockFileSystem(object):
self.dirs = {d for d in self.dirs if not should_remove(d)}
+ def remove_contents(self, dirname):
+ return _remove_contents(self, dirname, sleep=lambda *args, **kw: None)
+
def copytree(self, source, destination):
source = self.normpath(source)
destination = self.normpath(destination)

Powered by Google App Engine
This is Rietveld 408576698