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.hw_hangout.vp8" 7TIME = "MEDIUM" 8TEST_CATEGORY = "Performance" 9TEST_CLASS = "video" 10ATTRIBUTES = "suite:bvt-perbuild" 11TEST_TYPE = "server" 12DEPENDENCIES = "rpm, power:battery, hw_video_acc_vp8, hw_video_ac_enc_vp8" 13BUG_TEMPLATE = { 14 "labels": ["OS-Chrome", "VideoTestFailure"], 15} 16 17DOC = """ 18The test outputs the video power consumption for vp8 video decode. 19""" 20 21import logging 22 23from autotest_lib.client.common_lib import error 24 25# Used resources. They will be download in the beginning of the test. 26resources = [ 27 'crowd/crowd720-41e9a3e6a6b1644ebdb3f5723fce96e5.vp8', 28 'crowd/crowd180-bde69ca71393033d9187a2833720c9f8.vp8', 29 'crowd/crowd720-3cfe7b096f765742b4aa79e55fe7c994.yuv', 30 'crowd/crowd360-e84aac15c05b9b19250f3fc97722e0f6.yuv', 31 'crowd/crowd180-6d71fa96da062037482619df31830a97.yuv'] 32 33# The videos to be decoded. Each entry consists of the following parts: 34# [vidoe_name, width, height, frame_num, fragment_num, profile] 35decode_videos = [['crowd720.vp8', 1280, 720, 500, 502, 11]] 36decode_videos += [['crowd180.vp8', 320, 180, 500, 502, 11]] * 4 37 38# The videos to be encoded. 39# [video_name, width, height, profile, bit_rate] 40encode_videos = [ 41 ['crowd720.yuv', 1280, 720, 11, 1200000], 42 ['crowd360.yuv', 640, 360, 11, 500000], 43 ['crowd180.yuv', 320, 180, 11, 100000]] 44 45 46def _run_client_test(machine): 47 """Runs client test with battery actively discharging.""" 48 client = hosts.create_host(machine) 49 if not client.has_power(): 50 raise error.TestError("This test requires RPM support.") 51 52 try: 53 client.power_off() 54 client_at = autotest.Autotest(client) 55 client_at.run_test( 56 'video_HangoutHardwarePerf', resources=resources, 57 decode_videos=decode_videos, encode_videos=encode_videos, 58 measurement='power') 59 finally: 60 client.power_on() 61 62 63job.parallel_on_machines(_run_client_test, machines) 64