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

Unified Diff: Tools/Scripts/webkitpy/common/system/executive_mock.py

Issue 1187483002: Setup git-svn and handle detached HEAD state in auto-rebaseline script. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git auto-svn only when neccessary, add tests Created 5 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: Tools/Scripts/webkitpy/common/system/executive_mock.py
diff --git a/Tools/Scripts/webkitpy/common/system/executive_mock.py b/Tools/Scripts/webkitpy/common/system/executive_mock.py
index 1f137de283b0539e26882ab0d0be7cd13053e5c5..b5c4cacaa1f6d3ccb09a29a6503a1ecd5d5898c8 100644
--- a/Tools/Scripts/webkitpy/common/system/executive_mock.py
+++ b/Tools/Scripts/webkitpy/common/system/executive_mock.py
@@ -61,10 +61,12 @@ class MockExecutive(object):
def ignore_error(error):
pass
- def __init__(self, should_log=False, should_throw=False, should_throw_when_run=None):
+ def __init__(self, should_log=False, should_throw=False,
+ should_throw_when_run=None, should_return_zero_when_run=None):
self._should_log = should_log
self._should_throw = should_throw
self._should_throw_when_run = should_throw_when_run or set()
+ self._should_return_zero_when_run = should_return_zero_when_run or set()
# FIXME: Once executive wraps os.getpid() we can just use a static pid for "this" process.
self._running_pids = {'test-webkitpy': os.getpid()}
self._proc = None
@@ -115,6 +117,10 @@ class MockExecutive(object):
if self._should_throw:
raise ScriptError("MOCK ScriptError", output=output)
+
+ if return_exit_code and self._should_return_zero_when_run.intersection(args):
+ return 0
+
return output
def cpu_count(self):
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('j') | Tools/Scripts/webkitpy/tool/commands/rebaseline.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698