Home | History | Annotate | Download | only in brillo_RecordingAudioTest
      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 AUTHOR = 'ralphnathan'
      9 NAME = 'brillo_RecordingAudioTest.opensles.should'
     10 TIME = 'SHORT'
     11 TEST_CATEGORY = 'Functional'
     12 TEST_TYPE = 'Server'
     13 ATTRIBUTES = 'suite:brillo-audio'
     14 DEPENDENCIES = 'loopback-dongle'
     15 
     16 DOC = """
     17 Tests audio recording using OpenSL ES on a Brillo device.
     18 
     19 Test arguments:
     20 
     21     feedback=NAME  Name of the feedback client implementation to use. See
     22                    server.brillo.feedback.client_factory for supported values.
     23                    Default: 'loop'.
     24 
     25     feedback_args  Comma-separated list of initialization arguments for the
     26                    feedback client. Default: no additional arguments.
     27 """
     28 
     29 TEST_ARG_NAMES = ()
     30 args_dict = utils.args_to_dict(args)
     31 
     32 
     33 def run(machine):
     34     test_args = {name: args_dict[name] for name in TEST_ARG_NAMES
     35                  if name in args_dict}
     36     fb_client_name = args_dict.get('feedback', 'loop')
     37     fb_client = client_factory.get_audio_client(fb_client_name, NAME, machine,
     38                                                 args_dict.get('feedback_args'))
     39     job.run_test('brillo_RecordingAudioTest',
     40                  tag=NAME.split('.', 1)[1],
     41                  host=hosts.create_host(machine),
     42                  fb_client=fb_client,
     43                  recording_method='opensles',
     44                  use_file='true',
     45                  sample_widths_arr=[1],
     46                  sample_rates_arr=[16000, 22000, 44100],
     47                  num_channels_arr=[1, 2],
     48                  **test_args)
     49 
     50 
     51 parallel_simple(run, machines)
     52