Home | History | Annotate | Download | only in audio_PowerConsumption
      1 # Copyright 2015 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 AUTHOR = "rohitbm (a] chromium.org, Chrome OS Audio"
      6 NAME = "audio_PowerConsumption.mp3"
      7 TIME = "MEDIUM"
      8 TEST_CATEGORY = "Performance"
      9 TEST_CLASS = "audio"
     10 # TODO(ihf): enable once crbug.com/710338 is fixed.
     11 #ATTRIBUTES = "suite:bvt-perbuild"
     12 TEST_TYPE = "server"
     13 DEPENDENCIES = "rpm, power:battery"
     14 BUG_TEMPLATE = {
     15     "labels": ["OS-Chrome"],
     16     "components": ["OS>Kernel>Audio"],
     17 }
     18 
     19 DOC = """
     20 The test outputs the power consumption for various audio formats.
     21 """
     22 
     23 import logging
     24 
     25 from autotest_lib.client.common_lib import error
     26 
     27 VIDEO_NAME = "polka_crowd_128kbps_44_1khz.mp3"
     28 CHECKSUM = "7171529bb34c6e17dd163b03aa2b7c9c"
     29 
     30 def _run_client_test(machine):
     31     """Runs client test with battery actively discharging."""
     32     client = hosts.create_host(machine)
     33     if not client.has_power():
     34         raise error.TestError("This test requires RPM support.")
     35 
     36     try:
     37         client.power_off()
     38         client_at = autotest.Autotest(client)
     39         client_at.run_test("audio_PlaybackPower", test_file=VIDEO_NAME,
     40                            checksum=CHECKSUM)
     41     finally:
     42         client.power_on()
     43 
     44 
     45 job.parallel_on_machines(_run_client_test, machines)
     46