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 5AUTHOR = "rohitbm@chromium.org, Chrome OS Audio" 6NAME = "audio_PowerConsumption.mp3" 7TIME = "MEDIUM" 8TEST_CATEGORY = "Performance" 9TEST_CLASS = "audio" 10# TODO(ihf): enable once crbug.com/710338 is fixed. 11#ATTRIBUTES = "suite:bvt-perbuild" 12TEST_TYPE = "server" 13DEPENDENCIES = "rpm, power:battery" 14BUG_TEMPLATE = { 15 "labels": ["OS-Chrome"], 16 "components": ["OS>Kernel>Audio"], 17} 18 19DOC = """ 20The test outputs the power consumption for various audio formats. 21""" 22 23import logging 24 25from autotest_lib.client.common_lib import error 26 27VIDEO_NAME = "polka_crowd_128kbps_44_1khz.mp3" 28CHECKSUM = "7171529bb34c6e17dd163b03aa2b7c9c" 29 30def _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 45job.parallel_on_machines(_run_client_test, machines) 46