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

Side by Side Diff: tools/telemetry/telemetry/system_stub.py

Issue 11280142: Telemetry: fix AndroidBrowserFinderTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 """Provides stubs for os, sys and subprocess for testing 4 """Provides stubs for os, sys and subprocess for testing
5 5
6 This test allows one to test code that itself uses os, sys, and subprocess. 6 This test allows one to test code that itself uses os, sys, and subprocess.
7 """ 7 """
8 8
9 import os 9 import os
10 import re 10 import re
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 self.AdbCommands = AdbCommandsStubConstructor 69 self.AdbCommands = AdbCommandsStubConstructor
70 70
71 @staticmethod 71 @staticmethod
72 def IsAndroidSupported(): 72 def IsAndroidSupported():
73 return True 73 return True
74 74
75 def GetAttachedDevices(self): 75 def GetAttachedDevices(self):
76 return self.attached_devices 76 return self.attached_devices
77 77
78 @staticmethod 78 @staticmethod
79 def HasForwarder(_): 79 def HasForwarder(_=None):
80 return True 80 return True
81 81
82 class OsModuleStub(object): 82 class OsModuleStub(object):
83 class OsPathModuleStub(object): 83 class OsPathModuleStub(object):
84 def __init__(self, sys_module): 84 def __init__(self, sys_module):
85 self.sys = sys_module 85 self.sys = sys_module
86 self.files = [] 86 self.files = []
87 87
88 def exists(self, path): 88 def exists(self, path):
89 return path in self.files 89 return path in self.files
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 def __init__(self): 145 def __init__(self):
146 self.Popen = SubprocessModuleStub.PopenStub() 146 self.Popen = SubprocessModuleStub.PopenStub()
147 self.PIPE = None 147 self.PIPE = None
148 148
149 def call(self, *args, **kwargs): 149 def call(self, *args, **kwargs):
150 raise NotImplementedError() 150 raise NotImplementedError()
151 151
152 class SysModuleStub(object): 152 class SysModuleStub(object):
153 def __init__(self): 153 def __init__(self):
154 self.platform = '' 154 self.platform = ''
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698