Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1601)

Unified Diff: functional/perf.py

Issue 8764007: Adding Youtube dropped frames performance measurement for different types of videos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: functional/perf.py
===================================================================
--- functional/perf.py (revision 112101)
+++ functional/perf.py (working copy)
@@ -605,9 +605,9 @@
"""Returns true if video loaded bytes information is available."""
return self.GetVideoLoadedBytes() > 0
- def StartVideoForPerformance(self):
+ def StartVideoForPerformance(self, video_file_name='youtube.html'):
"""Start the test video with all required buffering."""
- self.PlayVideoAndAssert()
+ self.PlayVideoAndAssert(video_file_name)
self.ExecuteJavascript("""
ytplayer.setPlaybackQuality('hd720');
window.domAutomationController.send('');
@@ -631,19 +631,29 @@
time.sleep(10)
def testYoutubeDroppedFrames(self):
- """Measures the Youtube video dropped frames/second. Runs for 60 secs."""
- self.StartVideoForPerformance()
- init_dropped_frames = self.GetVideoDroppedFrames()
- total_dropped_frames = 0
- dropped_fps = []
- for _ in xrange(60):
- frames = self.GetVideoDroppedFrames() - init_dropped_frames
- current_dropped_frames = frames - total_dropped_frames
- dropped_fps.append(current_dropped_frames)
- total_dropped_frames = frames
- # Play the video for some time
- time.sleep(1)
- self._PrintSummaryResults('YoutubeDroppedFrames', dropped_fps, 'frames')
+ """Measures the Youtube video dropped frames/second. Runs for 60 secs.
+
+ This test measures Youtube video dropped frames for three different types
+ of videos like slow, normal and fast motion.
+ """
+ youtube_video = {'Slow':'youtube_Avril.html',
+ 'Normal':'youtube_Bourne.html',
+ 'Fast':'youtube_StarTrek.html'
+ }
+ for video_type in youtube_video:
+ self.StartVideoForPerformance(youtube_video[video_type])
+ init_dropped_frames = self.GetVideoDroppedFrames()
+ total_dropped_frames = 0
+ dropped_fps = []
+ for _ in xrange(60):
+ frames = self.GetVideoDroppedFrames() - init_dropped_frames
+ current_dropped_frames = frames - total_dropped_frames
+ dropped_fps.append(current_dropped_frames)
+ total_dropped_frames = frames
+ # Play the video for some time
+ time.sleep(1)
+ graph_description = 'YoutubeDroppedFrames' + '_' + video_type
+ self._PrintSummaryResults(graph_description, dropped_fps, 'frames')
def testYoutubeCPU(self):
"""Measures the Youtube video CPU usage. Runs for 60 seconds.

Powered by Google App Engine
This is Rietveld 408576698