1#!/usr/bin/env python 2# 3# Copyright (C) 2016 The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16# 17 18import logging 19 20from vts.runners.host import asserts 21from vts.runners.host import test_runner 22from vts.testcases.template.hal_hidl_host_test import hal_hidl_host_test 23 24TVINPUT_V1_0_HAL = "android.hardware.tv.input@1.0::ITvInput" 25 26 27class TvInputHidlTest(hal_hidl_host_test.HalHidlHostTest): 28 """Two hello world test cases which use the shell driver.""" 29 30 TEST_HAL_SERVICES = {TVINPUT_V1_0_HAL} 31 32 def setUpClass(self): 33 """Creates a mirror and init tv input hal.""" 34 super(TvInputHidlTest, self).setUpClass() 35 36 self.dut.hal.InitHidlHal( 37 target_type="tv_input", 38 target_basepaths=self.dut.libPaths, 39 target_version=1.0, 40 target_package="android.hardware.tv.input", 41 target_component_name="ITvInput", 42 hw_binder_service_name=self.getHalServiceName(TVINPUT_V1_0_HAL), 43 bits=int(self.abi_bitness)) 44 45 def testGetStreamConfigurations(self): 46 configs = self.dut.hal.tv_input.getStreamConfigurations(0) 47 logging.info('return value of getStreamConfigurations(0): %s', configs) 48 49 50if __name__ == "__main__": 51 test_runner.main() 52