• 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
5AUTHOR = "Chromium OS Project"
6NAME = "desktopui_MediaAudioFeedback"
7PURPOSE = "Verify sound from media files is audible"
8CRITERIA = """
9This test will fail if media files sound is not audible.
10"""
11ATTRIBUTES = "suite:bvt-perbuild"
12TIME = "SHORT"
13TEST_CATEGORY = "General"
14TEST_CLASS = "desktopui"
15TEST_TYPE = "client"
16DEPENDENCIES = 'audio_loopback_dongle'
17
18DOC = """
19Test that the sound from media files can be heard by recording from mic in.
20Each audio channel is tested independently and currently there is no accurate
21comparison with the input data. Instead the test passes when
22a) the silent signal is sufficiently weak and (TODO: rohitbm@chromium.org)
23b) the captured audio from each media replay is sufficiently loud.
24
25NOTE: For this test to pass you need to have the line out looped back to mic-in.
26This can be through a 3.5mm male-to-male cable or a loopback dongle depending on
27your device.
28"""
29
30# Media formats to be tested. The length of these audio are all 5 seconds.
31TEST_DURATION = 5
32TEST_FILES = ['sine440.mp3',
33              'sine440.mp4',
34              'sine440.wav',
35              'sine440.ogv',
36              'sine440.webm']
37
38constraints = ['%s_rms_value > 0.05' % s.replace('.', '_') for s in TEST_FILES]
39
40job.run_test('desktopui_MediaAudioFeedback',
41             test_files=TEST_FILES,
42             test_duration=TEST_DURATION,
43             constraints=constraints)
44