diff options
-rwxr-xr-x | chrome/test/functional/media/media_jerky.py | 21 | ||||
-rw-r--r-- | chrome/test/functional/media/media_test_env_names.py | 3 | ||||
-rwxr-xr-x | chrome/test/functional/media/media_test_runner.py | 6 |
3 files changed, 26 insertions, 4 deletions
diff --git a/chrome/test/functional/media/media_jerky.py b/chrome/test/functional/media/media_jerky.py index 897de6f..7cd5013 100755 --- a/chrome/test/functional/media/media_jerky.py +++ b/chrome/test/functional/media/media_jerky.py @@ -7,10 +7,10 @@ This PyAuto powered script plays media (video or audio) files using the HTML5 tag embedded in an HTML file (specified in the GetPlayerHTMLFileName() method) -for a test that uses a jerky tool that is being developed. The tool will measure -display Frame-per-second (FPS) (instead of decode FPS, which is measured in -media_fps.py). The tool requires predefined pattern to show before video plays -to determine the area to be measured (it is done in +for a test that uses a jerky tool that is being developed. The tool will +measure display Frame-per-second (FPS) (instead of decode FPS, which is +measured in media_fps.py). The tool requires predefined pattern to show before +video plays to determine the area to be measured (it is done in data/media/html/media_jerky.html). The parameters needed to run this test are passed in the form of environment @@ -18,6 +18,7 @@ variables (such as the number of runs). Media_perf_runner.py is used for generating these variables (PyAuto does not support direct parameters). """ import os +import subprocess import time from media_test_base import MediaTestBase @@ -41,6 +42,18 @@ class MediaPlaybackTimeTest(MediaTestBase): """A method to get the player HTML file name.""" return 'media_jerky.html' + def PreEachRunProcess(self, unused_run_counter): + """Starts the jerky tool. Executes before each test run. + + Args: + unused_run_counter: counter for each run. + """ + jerky_tool_binary_loc = os.getenv( + MediaTestEnvNames.JERKY_TOOL_BINARY_LOCATION_ENV_NAME, '') + if jerky_tool_binary_loc: + proc = subprocess.Popen(jerky_tool_binary_loc, shell=True) + proc.communicate() + if __name__ == '__main__': pyauto_media.Main() diff --git a/chrome/test/functional/media/media_test_env_names.py b/chrome/test/functional/media/media_test_env_names.py index 8401c26..5110936 100644 --- a/chrome/test/functional/media/media_test_env_names.py +++ b/chrome/test/functional/media/media_test_env_names.py @@ -69,3 +69,6 @@ class MediaTestEnvNames: # Define this if this is jerky test. JERKY_TEST_ENV_NAME = 'JERKY_TEST' + + # Define location of jerky tool binary. + JERKY_TOOL_BINARY_LOCATION_ENV_NAME = 'JERKY_TOOL_LOC' diff --git a/chrome/test/functional/media/media_test_runner.py b/chrome/test/functional/media/media_test_runner.py index 543347d..59c31e8 100755 --- a/chrome/test/functional/media/media_test_runner.py +++ b/chrome/test/functional/media/media_test_runner.py @@ -137,6 +137,9 @@ def main(): dest='number_of_extra_players', help=('The number of extra players for ' 'stress testing using the same media file.')) + parser.add_option('-l', '--jerky-tool-location', + dest='jerky_tool_location', + help='The location of the jerky tool binary.') options, args = parser.parse_args() if args: parser.print_help() @@ -249,6 +252,9 @@ def main(): if options.number_of_extra_players: envs[MediaTestEnvNames.N_EXTRA_PLAYERS_ENV_NAME] = ( options.number_of_extra_players) + if options.jerky_tool_location: + envs[MediaTestEnvNames.JERKY_TOOL_BINARY_LOCATION_ENV_NAME] = ( + options.jerky_tool_location) envs.update(parent_envs) if options.suite is None and options.test_prog_name is not None: # Suite is not used - run test program directly. |