summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-01 18:31:59 +0000
committerimasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-01 18:31:59 +0000
commitc878133c3eda3e43830c108c8c8ea4aa81bc2a0f (patch)
tree200bff0d1da32f04581cccde8726ac4a2f00fb18
parentbd28b5a500cdb63737a0648de89316997b013868 (diff)
downloadchromium_src-c878133c3eda3e43830c108c8c8ea4aa81bc2a0f.zip
chromium_src-c878133c3eda3e43830c108c8c8ea4aa81bc2a0f.tar.gz
chromium_src-c878133c3eda3e43830c108c8c8ea4aa81bc2a0f.tar.bz2
Add execution of jerky tool in media performance test.
Review URL: http://codereview.chromium.org/7278015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91330 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/test/functional/media/media_jerky.py21
-rw-r--r--chrome/test/functional/media/media_test_env_names.py3
-rwxr-xr-xchrome/test/functional/media/media_test_runner.py6
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.