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

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

Issue 2066963002: Add file permissions to filesystem_mock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: corrected filesystem make_executable to copy permissions to new file Created 4 years, 6 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 44c7d8043d507f9dad2c683232b2e28ea01e5dd7..fc1e1c22e665b8ca9de0f39526b624b8d4556cf5 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
@@ -49,6 +49,7 @@ class MockFileSystem(object):
not exist.
"""
self.files = files or {}
+ self.executable_files = set()
self.written_files = {}
self.last_tmpdir = None
self.current_tmpno = 0
@@ -60,7 +61,6 @@ class MockFileSystem(object):
while not d in self.dirs:
self.dirs.add(d)
d = self.dirname(d)
-
def clear_written_files(self):
# This function can be used to track what is written between steps in a test.
self.written_files = {}
@@ -75,6 +75,13 @@ class MockFileSystem(object):
return path.rsplit(self.sep, 1)
return ('', path)
+ def is_executable(self, file_path):
+ return file_path in self.executable_files
+
+ def make_executable(self, orig_path, new_path):
+ if self.is_executable(orig_path):
+ self.executable_files.add(new_path)
+
def abspath(self, path):
if os.path.isabs(path):
return self.normpath(path)

Powered by Google App Engine
This is Rietveld 408576698