Home | History | Annotate | Download | only in video_PowerConsumption
      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.hw_hangout.vp8"
      7 TIME = "MEDIUM"
      8 TEST_CATEGORY = "Performance"
      9 TEST_CLASS = "video"
     10 ATTRIBUTES = "suite:bvt-perbuild"
     11 TEST_TYPE = "server"
     12 DEPENDENCIES = "rpm, power:battery, hw_video_acc_vp8, hw_video_ac_enc_vp8"
     13 BUG_TEMPLATE = {
     14     "labels": ["OS-Chrome", "VideoTestFailure"],
     15 }
     16 
     17 DOC = """
     18 The test outputs the video power consumption for vp8 video decode.
     19 """
     20 
     21 import logging
     22 
     23 from autotest_lib.client.common_lib import error
     24 
     25 # Used resources. They will be download in the beginning of the test.
     26 resources = [
     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]
     35 decode_videos  = [['crowd720.vp8', 1280, 720, 500, 502, 11]]
     36 decode_videos += [['crowd180.vp8', 320, 180, 500, 502, 11]] * 4
     37 
     38 # The videos to be encoded.
     39 #   [video_name, width, height, profile, bit_rate]
     40 encode_videos = [
     41     ['crowd720.yuv', 1280, 720, 11, 1200000],
     42     ['crowd360.yuv', 640, 360, 11, 500000],
     43     ['crowd180.yuv', 320, 180, 11, 100000]]
     44 
     45 
     46 def _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 
     63 job.parallel_on_machines(_run_client_test, machines)
     64