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

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

Issue 2453513002: Change default behavior of --seed to be unix timestamp (Closed)
Patch Set: Replace custom MockTime with host.time Created 4 years, 2 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/systemhost_mock.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py
index 6457872977577ddc32e51d801af641d0dc7ba2df..ddb76437d5f5604afb564029ae3d39df385e2e54 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/systemhost_mock.py
@@ -37,7 +37,7 @@ from webkitpy.common.system.workspace_mock import MockWorkspace
class MockSystemHost(object):
- def __init__(self, log_executive=False, executive_throws_when_run=None,
+ def __init__(self, time_return_val=123, log_executive=False, executive_throws_when_run=None,
os_name=None, os_version=None, executive=None, filesystem=None):
self.executable = 'python'
self.executive = executive or MockExecutive(should_log=log_executive, should_throw_when_run=executive_throws_when_run)
@@ -60,8 +60,19 @@ class MockSystemHost(object):
'PATH': '/bin:/mock/bin'
}
+ self.time = MockTime(time_return_val)
+
def print_(self, *args, **kwargs):
sep = kwargs.get('sep', ' ')
end = kwargs.get('end', '\n')
stream = kwargs.get('stream', self.stdout)
stream.write(sep.join([str(arg) for arg in args]) + end)
+
+
+class MockTime(object):
+
+ def __init__(self, time_return_val):
+ self.time_return_val = time_return_val
+
+ def time(self):
+ return self.time_return_val

Powered by Google App Engine
This is Rietveld 408576698