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 5AUTHOR = "Chrome OS Team" 6NAME = "video_PowerConsumption.h264" 7TIME = "MEDIUM" 8TEST_CATEGORY = "Performance" 9TEST_CLASS = "video" 10ATTRIBUTES = "suite:bvt-perbuild" 11TEST_TYPE = "server" 12DEPENDENCIES = "rpm, power:battery" 13BUG_TEMPLATE = { 14 "labels": ["OS-Chrome", "VideoTestFailure"], 15} 16 17DOC = """ 18The test outputs the video power consumption for H264 video decode. 19""" 20 21import logging 22 23from autotest_lib.client.common_lib import error 24 25 26VIDEO_NAME = "traffic/traffic-1920x1080-8005020218f6b86bfa978e550d04956e.mp4" 27VIDEO_DESCRIPTION = "h264_1080p" 28 29def _run_client_test(machine): 30 """Runs client test with battery actively discharging.""" 31 client = hosts.create_host(machine) 32 if not client.has_power(): 33 raise error.TestError("This test requires RPM support.") 34 35 try: 36 client.power_off() 37 client_at = autotest.Autotest(client) 38 client_at.run_test("video_PlaybackPerf", video_name=VIDEO_NAME, 39 video_description=VIDEO_DESCRIPTION, power_test=True) 40 finally: 41 client.power_on() 42 43 44job.parallel_on_machines(_run_client_test, machines) 45