1# Copyright 2012 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5from py_trace_event import trace_event 6 7 8class AppBackend(object): 9 10 __metaclass__ = trace_event.TracedMetaClass 11 12 def __init__(self, app_type, platform_backend): 13 super(AppBackend, self).__init__() 14 self._app = None 15 self._app_type = app_type 16 self._platform_backend = platform_backend 17 18 def __del__(self): 19 self.Close() 20 21 def SetApp(self, app): 22 self._app = app 23 24 @property 25 def app(self): 26 return self._app 27 28 @property 29 def app_type(self): 30 return self._app_type 31 32 @property 33 def pid(self): 34 raise NotImplementedError 35 36 @property 37 def platform_backend(self): 38 return self._platform_backend 39 40 def Start(self): 41 raise NotImplementedError 42 43 def Foreground(self): 44 # TODO(catapult:#2194): Remove the unnecessary pass below when the method 45 # has been implemented on all concrete subclasses. 46 pass # pylint: disable=unnecessary-pass 47 raise NotImplementedError 48 49 def Background(self): 50 raise NotImplementedError 51 52 def Close(self): 53 raise NotImplementedError 54 55 def IsAppRunning(self): 56 raise NotImplementedError 57 58 def GetStandardOutput(self): 59 raise NotImplementedError 60 61 def GetStackTrace(self): 62 raise NotImplementedError 63 64 def GetMostRecentMinidumpPath(self): 65 raise NotImplementedError 66