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

Unified Diff: tools/telemetry/telemetry/unittest_util/system_stub.py

Issue 1005903004: Revert of Refactor serving_dirs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: tools/telemetry/telemetry/unittest_util/system_stub.py
diff --git a/tools/telemetry/telemetry/unittest_util/system_stub.py b/tools/telemetry/telemetry/unittest_util/system_stub.py
index e0073ca22b9560df6a63c45cd28a04715f67518f..634431e3c545b21823c18246f62f39601d52069f 100644
--- a/tools/telemetry/telemetry/unittest_util/system_stub.py
+++ b/tools/telemetry/telemetry/unittest_util/system_stub.py
@@ -291,17 +291,6 @@
self, self.INTERNAL_BUCKET, remote_path, local_path, True)
return result
- def GetFilesInDirectoryIfChanged(self, directory, bucket):
- if os.path.dirname(directory) == directory: # If in the root dir.
- raise ValueError('Trying to serve root directory from HTTP server.')
- for dirpath, _, filenames in os.walk(directory):
- for filename in filenames:
- path, extension = os.path.splitext(
- os.path.join(dirpath, filename))
- if extension != '.sha1':
- continue
- self.GetIfChanged(path, bucket)
-
def CalculateHash(self, file_path):
return self.local_file_hashes[file_path]
@@ -366,16 +355,12 @@
def __init__(self, sys_module):
self.sys = sys_module
self.files = []
- self.dirs = []
def exists(self, path):
return path in self.files
def isfile(self, path):
return path in self.files
-
- def isdir(self, path):
- return path in self.dirs
def join(self, *paths):
def IsAbsolutePath(path):
@@ -399,10 +384,6 @@
return tmp.replace('\\', '/')
@staticmethod
- def abspath(path):
- return os.path.abspath(path)
-
- @staticmethod
def expanduser(path):
return os.path.expanduser(path)
@@ -414,13 +395,8 @@
def splitext(path):
return os.path.splitext(path)
- @staticmethod
- def splitdrive(path):
- return os.path.splitdrive(path)
-
X_OK = os.X_OK
- sep = os.sep
pathsep = os.pathsep
def __init__(self, sys_module=sys):
@@ -432,7 +408,6 @@
self.program_files = None
self.program_files_x86 = None
self.devnull = os.devnull
- self._directory = {}
def access(self, path, _):
return path in self.path.files
@@ -455,10 +430,6 @@
def chdir(self, path):
pass
- def walk(self, top):
- for dir_name in self._directory:
- yield top, dir_name, self._directory[dir_name]
-
class PerfControlModuleStub(object):
class PerfControlStub(object):
« no previous file with comments | « tools/telemetry/telemetry/page/page_set_unittest.py ('k') | tools/telemetry/telemetry/unittest_util/system_stub_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698