Ralph Nathan | 71e94bd | 2016-01-29 18:26:19 -0800 | [diff] [blame] | 1 | # Copyright 2016 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 | from autotest_lib.client.common_lib import utils |
| 6 | from autotest_lib.server.brillo.feedback import client_factory |
| 7 | |
| 8 | |
| 9 | AUTHOR = 'garnold, ralphnathan' |
| 10 | NAME = 'brillo_FileOpenSLESPlaybackAudioTest' |
| 11 | TIME = 'SHORT' |
| 12 | TEST_CATEGORY = 'Functional' |
| 13 | TEST_TYPE = 'Server' |
| 14 | ATTRIBUTES = 'suite:brillo-audio' |
| 15 | SUITE = 'brillo-audio' |
| 16 | |
| 17 | DOC = """ |
| 18 | Tests audio playback using OpenSL ES and a file on a Brillo device. |
| 19 | |
| 20 | Test arguments: |
| 21 | |
| 22 | feedback=NAME Name of the feedback client implementation to use. See |
| 23 | server.brillo.feedback.client_factory for supported values. |
| 24 | Default: 'loop'. |
Ralph Nathan | e3b189c | 2016-02-04 14:17:29 -0800 | [diff] [blame] | 25 | |
| 26 | feedback_args Comma-separated list of initialization arguments for the |
| 27 | feedback client. Default: no additional arguments. |
Ralph Nathan | 71e94bd | 2016-01-29 18:26:19 -0800 | [diff] [blame] | 28 | """ |
| 29 | |
| 30 | TEST_ARG_NAMES = () |
| 31 | args_dict = utils.args_to_dict(args) |
| 32 | |
| 33 | |
| 34 | def run(machine): |
| 35 | test_args = {name: args_dict[name] for name in TEST_ARG_NAMES |
| 36 | if name in args_dict} |
| 37 | fb_client_name = args_dict.get('feedback', 'loop') |
Ralph Nathan | e3b189c | 2016-02-04 14:17:29 -0800 | [diff] [blame] | 38 | fb_client = client_factory.get_audio_client(fb_client_name, NAME, machine, |
| 39 | args_dict.get('feedback_args')) |
Ralph Nathan | 71e94bd | 2016-01-29 18:26:19 -0800 | [diff] [blame] | 40 | job.run_test('brillo_PlaybackAudioTest', |
| 41 | host=hosts.create_host(machine), |
| 42 | fb_client=fb_client, |
| 43 | playback_method='opensles', |
| 44 | use_file='true', |
| 45 | **test_args) |
| 46 | |
| 47 | |
| 48 | parallel_simple(run, machines) |