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

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

Issue 2821543003: In run-webkit-tests, start xvfb if necessary. (Closed)
Patch Set: Check process after starting, wait after killing, change stderr redirect to DEVNULL Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 def poll(self): 50 def poll(self):
51 # Consider the process completed when all the stdout and stderr has been read. 51 # Consider the process completed when all the stdout and stderr has been read.
52 if self.stdout.len != self.stdout.tell() or self.stderr.len != self.stde rr.tell(): 52 if self.stdout.len != self.stdout.tell() or self.stderr.len != self.stde rr.tell():
53 return None 53 return None
54 return self.returncode 54 return self.returncode
55 55
56 def communicate(self, *_): 56 def communicate(self, *_):
57 return (self.stdout.getvalue(), self.stderr.getvalue()) 57 return (self.stdout.getvalue(), self.stderr.getvalue())
58 58
59 def kill(self):
60 return
61
59 62
60 class MockExecutive(object): 63 class MockExecutive(object):
61 PIPE = 'MOCK PIPE' 64 PIPE = 'MOCK PIPE'
62 STDOUT = 'MOCK STDOUT' 65 STDOUT = 'MOCK STDOUT'
63 DEVNULL = 'MOCK_DEVNULL' 66 DEVNULL = 'MOCK_DEVNULL'
64 67
65 @staticmethod 68 @staticmethod
66 def ignore_error(error): 69 def ignore_error(error):
67 pass 70 pass
68 71
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 200
198 201
199 def mock_git_commands(vals, strict=False): 202 def mock_git_commands(vals, strict=False):
200 def run_fn(args): 203 def run_fn(args):
201 sub_command = args[1] 204 sub_command = args[1]
202 if strict and sub_command not in vals: 205 if strict and sub_command not in vals:
203 raise AssertionError('{} not found in sub-command list {}'.format( 206 raise AssertionError('{} not found in sub-command list {}'.format(
204 sub_command, vals)) 207 sub_command, vals))
205 return vals.get(sub_command, '') 208 return vals.get(sub_command, '')
206 return MockExecutive(run_command_fn=run_fn) 209 return MockExecutive(run_command_fn=run_fn)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698