1 # Copyright (c) 2014 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 = "Chrome OS Team" 6 NAME = "video_PowerConsumption.h264" 7 TIME = "MEDIUM" 8 TEST_CATEGORY = "Performance" 9 TEST_CLASS = "video" 10 ATTRIBUTES = "suite:bvt-perbuild" 11 SUITE = "bvt-perbuild" 12 TEST_TYPE = "server" 13 DEPENDENCIES = "rpm, power:battery" 14 BUG_TEMPLATE = { 15 "labels": ["OS-Chrome", "VideoTestFailure"], 16 } 17 18 DOC = """ 19 The test outputs the video power consumption for H264 video decode. 20 """ 21 22 import logging 23 24 from autotest_lib.client.common_lib import error 25 26 27 VIDEO_NAME = "traffic-1920x1080-8005020218f6b86bfa978e550d04956e.mp4" 28 VIDEO_DESCRIPTION = "h264_1080p" 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 client.power_off() 37 try: 38 client_at = autotest.Autotest(client) 39 client_at.run_test("video_PlaybackPerf", video_name=VIDEO_NAME, 40 video_description=VIDEO_DESCRIPTION, power_test=True) 41 finally: 42 client.power_on() 43 44 45 job.parallel_on_machines(_run_client_test, machines) 46