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