1# Copyright 2016 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 5"""A test which verifies the function of hardware JPEG decode accelerator.""" 6 7import logging 8from autotest_lib.client.cros import chrome_binary_test 9from autotest_lib.client.cros.video import helper_logger 10 11class video_JpegDecodeAccelerator(chrome_binary_test.ChromeBinaryTest): 12 """ 13 This test is a wrapper of the chrome unittest binary: 14 jpeg_decode_accelerator_unittest. 15 16 The jpeg_decode_accelerator_unittest uses the built-in default JPEG image: 17 peach_pi-1280x720.jpg during test. The image is bundled as part of the 18 chromeos-chrome package if USE=build_test is set. ChromeBinaryTest will 19 automatically locate the image for us when the test is run. 20 """ 21 22 version = 1 23 binary = 'jpeg_decode_accelerator_unittest' 24 25 26 @helper_logger.video_log_wrapper 27 @chrome_binary_test.nuke_chrome 28 def run_once(self, gtest_filter=None): 29 """ 30 Runs jpeg_decode_accelerator_unittest on the device. 31 32 @param gtest_filter: test case filter. 33 34 @raises: error.TestFail for jpeg_decode_accelerator_unittest failures. 35 """ 36 logging.debug('Starting video_JpegDecodeAccelerator') 37 cmd_line_list = [helper_logger.chrome_vmodule_flag()] 38 if gtest_filter: 39 cmd_line_list.append('--gtest_filter="%s"' % gtest_filter) 40 41 cmd_line = ' '.join(cmd_line_list) 42 self.run_chrome_test_binary(self.binary, cmd_line) 43