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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py

Issue 2014063002: Run format-webkit on webkitpy code (without string conversion). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 # Copyright (C) 2011 Google Inc. All rights reserved. 1 # Copyright (C) 2011 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 return command_outputs 167 return command_outputs
168 168
169 def map(self, thunk, arglist, processes=None): 169 def map(self, thunk, arglist, processes=None):
170 return map(thunk, arglist) 170 return map(thunk, arglist)
171 171
172 def process_dump(self): 172 def process_dump(self):
173 return [] 173 return []
174 174
175 175
176 class MockExecutive2(MockExecutive): 176 class MockExecutive2(MockExecutive):
177
177 """MockExecutive2 is like MockExecutive except it doesn't log anything.""" 178 """MockExecutive2 is like MockExecutive except it doesn't log anything."""
178 179
179 def __init__(self, output='', exit_code=0, exception=None, run_command_fn=No ne, stderr=''): 180 def __init__(self, output='', exit_code=0, exception=None, run_command_fn=No ne, stderr=''):
180 self._output = output 181 self._output = output
181 self._stderr = stderr 182 self._stderr = stderr
182 self._exit_code = exit_code 183 self._exit_code = exit_code
183 self._exception = exception 184 self._exception = exception
184 self._run_command_fn = run_command_fn 185 self._run_command_fn = run_command_fn
185 self.calls = [] 186 self.calls = []
186 187
(...skipping 14 matching lines...) Expand all
201 if self._run_command_fn: 202 if self._run_command_fn:
202 return self._run_command_fn(args) 203 return self._run_command_fn(args)
203 if return_exit_code: 204 if return_exit_code:
204 return self._exit_code 205 return self._exit_code
205 if self._exit_code and error_handler: 206 if self._exit_code and error_handler:
206 script_error = ScriptError(script_args=args, exit_code=self._exit_co de, output=self._output) 207 script_error = ScriptError(script_args=args, exit_code=self._exit_co de, output=self._output)
207 error_handler(script_error) 208 error_handler(script_error)
208 if return_stderr: 209 if return_stderr:
209 return self._output + self._stderr 210 return self._output + self._stderr
210 return self._output 211 return self._output
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698