1# Copyright 2018 The Chromium OS 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 5"""An adapter to remotely access the DUT graphics facade.""" 6 7 8class GraphicsFacadeRemoteAdapter(object): 9 """GraphicsFacadeRemoteAdapter remotely monitors graphics hangs.""" 10 11 12 def __init__(self, remote_facade_proxy): 13 """Construct a GraphicsFacadeRemoteAdapter. 14 15 @param remote_facade_proxy: RemoteFacadeProxy object. 16 17 """ 18 self._proxy = remote_facade_proxy 19 20 21 @property 22 def _graphics_proxy(self): 23 """Gets the proxy to DUT USB facade. 24 25 @return XML RPC proxy to DUT graphics facade. 26 27 """ 28 return self._proxy.graphics 29 30 31 def graphics_state_checker_initialize(self): 32 """Create and initialize the graphics state checker object. 33 34 This will establish existing errors and take a snapshot of graphics 35 kernel memory. 36 37 """ 38 self._graphics_proxy.graphics_state_checker_initialize() 39 40 41 def graphics_state_checker_finalize(self): 42 """Throw an error on new GPU hang messages in system logs.""" 43 self._graphics_proxy.graphics_state_checker_finalize() 44