• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2013 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
5import logging
6import os
7
8from autotest_lib.server import autotest
9from autotest_lib.server import hosts
10from autotest_lib.server import test
11
12
13class video_VDAStress(test.test):
14    """
15    VDA stress test run client video_VideoDecodeAccelerator tests on a list of
16    videos.
17    """
18    version = 1
19
20    def run_once(self, machine, server_videos_dir, videos):
21        host = hosts.create_host(machine)
22        host_at = autotest.Autotest(host)
23        for video in videos:
24            # Copy test vidoes from the server to the client.
25            file_name, sep, video_arg = video.partition(':')
26            file_path_at_server = os.path.join(server_videos_dir, file_name)
27            file_path_at_client = '/tmp/%s' % file_name
28            host.send_file(file_path_at_server, file_path_at_client)
29            logging.info("Copied to the client: %s" % file_path_at_client)
30
31            # Run the client test with the downloaded video.
32            host_at.run_test('video_VideoDecodeAccelerator', videos=['%s%s%s' %
33                             (file_path_at_client, sep, video_arg)],
34                             use_cr_source_dir=False,
35                             gtest_filter='DecodeVariations*\/0')
36            host.run('rm %s' % file_path_at_client)
37