blob: ee9b2c96044f0f1db2d26ae4499dbcb681cf498e [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
from autotest_lib.server import autotest, test
from autotest_lib.server.cros.multimedia import remote_facade_factory
class camera_HAL3Server(test.test):
Server side camera_HAL3 test for configure dummy image on chart tablet and
run test on DUT.
version = 1
SCENE_NAME = 'scene.pdf'
BRIGHTNESS_CMD = 'backlight_tool --get_brightness_percent'
SET_BRIGHTNESS_CMD = 'backlight_tool --set_brightness_percent=%s'
def setup(self, chart_host):
# prepare chart device
self.chart_dir = chart_host.get_tmp_dir()
logging.debug('chart_dir=%s', self.chart_dir)
self.display_facade = remote_facade_factory.RemoteFacadeFactory(
# set chart display brightness
self.init_display_level =
self.BRIGHTNESS_CMD).stdout.rstrip() % self.DISPLAY_LEVEL)
# keep display always on'stop powerd', ignore_status=True)
# scp scene to chart_host
os.path.join(self.bindir, 'files', self.SCENE_NAME),
self.chart_dir)'chmod', args=('-R', '755', self.chart_dir))
# display scene
'file://' + os.path.join(self.chart_dir, self.SCENE_NAME))
def run_once(self, host, chart_host, **kwargs):
autotest.Autotest(host).run_test('camera_HAL3', **kwargs)
def cleanup(self, chart_host):
# restore display default behavior'start powerd', ignore_status=True) % self.init_display_level)