Added a new pyauto-based flash video performance test to perf.py.

This test must be run manually for now, and will be used in its current
state only temporarily to compare results across different ChromeOS
devices.

BUG=None
TEST=Verified the test runs successfully on a local Alex device.

Review URL: https://chromiumcodereview.appspot.com/9320001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120015 0039d316-1c4b-4281-b951-d872f2087c98
parent 12106aad
......@@ -911,6 +911,49 @@ class YoutubePerfTest(BasePerfTest, YoutubeTestHelper):
graph_name='YoutubeCPUExtrapolation')
class FlashVideoPerfTest(BasePerfTest):
"""General flash video performance tests."""
def FlashVideo1080P(self):
"""Measures total dropped frames and average FPS for a 1080p flash video.
This is a temporary test to be run manually for now, needed to collect some
performance statistics across different ChromeOS devices.
"""
# Open up the test webpage; it's assumed the test will start automatically.
webpage_url = 'http://www/~arscott/fl/FlashVideoTests.html'
self.assertTrue(self.AppendTab(pyauto.GURL(webpage_url)),
msg='Failed to append tab for webpage.')
# Wait until the test is complete.
js_is_done = """
window.domAutomationController.send(JSON.stringify(tests_done));
"""
self.assertTrue(
self.WaitUntil(
lambda: self.ExecuteJavascript(js_is_done, tab_index=1) == 'true',
timeout=300, expect_retval=True, retry_sleep=1),
msg='Timed out when waiting for test result.')
# Retrieve and output the test results.
js_results = """
window.domAutomationController.send(JSON.stringify(tests_results));
"""
test_result = eval(self.ExecuteJavascript(js_results, tab_index=1))
test_result[0] = test_result[0].replace('true', 'True')
test_result = eval(test_result[0]) # Webpage only does 1 test right now.
description = 'FlashVideo1080P'
result = test_result['averageFPS']
logging.info('Result for %s: %f FPS (average)', description, result)
self._OutputPerfGraphValue(description, result, 'FPS',
graph_name=description)
result = test_result['droppedFrames']
logging.info('Result for %s: %f dropped frames', description, result)
self._OutputPerfGraphValue(description, result, 'DroppedFrames',
graph_name=description)
class WebGLTest(BasePerfTest):
"""Tests for WebGL performance."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment