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.
7 """ A running application instance that can be controlled in a limited way.
9 Be sure to clean up after yourself by calling Close() when you are done with
10 the app. Or better yet:
11 with possible_app.Create(options) as app:
12 ... do all your operations on app here
14 def __init__(self
, app_backend
, platform_backend
):
15 assert platform_backend
.platform
!= None
16 self
._app
_backend
= app_backend
17 self
._platform
_backend
= platform_backend
18 self
._app
_backend
.SetApp(self
)
22 return self
._app
_backend
.app_type
26 return self
._platform
_backend
.platform
31 def __exit__(self
, *args
):
35 raise NotImplementedError()
37 def GetStandardOutput(self
):
38 return self
._app
_backend
.GetStandardOutput()
40 def GetStackTrace(self
):
41 return self
._app
_backend
.GetStackTrace()
43 def GetMostRecentMinidumpPath(self
):
44 return self
._app
_backend
.GetMostRecentMinidumpPath()