Home | History | Annotate | Download | only in audio_AudioRoutingUSB
      1 # Copyright (c) 2012 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.server import utils
      6 
      7 AUTHOR = 'The Chromium OS Authors'
      8 NAME = 'audio_AudioRoutingUSB'
      9 PURPOSE = 'Verify audio is routed to USB headset correctly.'
     10 CRITERIA = """
     11 After a USB headset is plugged in, CRAS should route the audio
     12 to the new device. After the USB headset is unplugged, the audio
     13 should be routed back to the original device. We check if the
     14 correct device file (/dev/snd/pcmCXDY) is opened in each case.
     15 """
     16 TIME='FAST'
     17 TEST_CATEGORY = 'Functional'
     18 TEST_CLASS = "audio"
     19 TEST_TYPE = 'server'
     20 
     21 DOC = """
     22 This test uses servo to simulate plugging/unplugging a USB headset. Before
     23 running the test, a USB headset should be plugged into DUT_USB (TYPE A/J4),
     24 and DUT_IN (TYPE MICRO-B/J5) should be connected to a USB port on the device.
     25 """
     26 
     27 args_dict = utils.args_to_dict(args)
     28 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     29 
     30 def run(machine):
     31     host = hosts.create_host(machine, servo_args=servo_args)
     32     job.run_test("audio_AudioRoutingUSB", host=host)
     33 
     34 parallel_simple(run, machines)
     35