| OLD | NEW |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 # object will be used. Generally speaking unit tests should | 43 # object will be used. Generally speaking unit tests should |
| 44 # subclass this or provider wrapper functions that set a common | 44 # subclass this or provider wrapper functions that set a common |
| 45 # set of options. | 45 # set of options. |
| 46 self.update(**kwargs) | 46 self.update(**kwargs) |
| 47 | 47 |
| 48 def update(self, **kwargs): | 48 def update(self, **kwargs): |
| 49 self.__dict__.update(**kwargs) | 49 self.__dict__.update(**kwargs) |
| 50 return self | 50 return self |
| 51 | 51 |
| 52 def ensure_value(self, key, value): | 52 def ensure_value(self, key, value): |
| 53 if getattr(self, key, None) == None: | 53 if getattr(self, key, None) is None: |
| 54 self.__dict__[key] = value | 54 self.__dict__[key] = value |
| 55 return self.__dict__[key] | 55 return self.__dict__[key] |
| 56 | 56 |
| 57 | 57 |
| 58 # FIXME: This should be renamed MockWebKitPatch. | 58 # FIXME: This should be renamed MockWebKitPatch. |
| 59 class MockTool(MockHost): | 59 class MockTool(MockHost): |
| 60 | 60 |
| 61 def __init__(self, *args, **kwargs): | 61 def __init__(self, *args, **kwargs): |
| 62 MockHost.__init__(self, *args, **kwargs) | 62 MockHost.__init__(self, *args, **kwargs) |
| 63 | 63 |
| 64 self._deprecated_port = MockPort() | 64 self._deprecated_port = MockPort() |
| 65 | 65 |
| 66 def deprecated_port(self): | 66 def deprecated_port(self): |
| 67 return self._deprecated_port | 67 return self._deprecated_port |
| 68 | 68 |
| 69 def path(self): | 69 def path(self): |
| 70 return "echo" | 70 return "echo" |
| OLD | NEW |