Chromium Code Reviews| 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_id='zuzaxlddWbk'): |
| """Start the test video with all required buffering.""" |
| - self.PlayVideoAndAssert() |
| + self.PlayVideoAndAssert(video_id) |
| 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':'VT1-sitWRtY', |
| + 'Normal':'2tqK_3mKQUw', |
| + 'Fast':'8ETDE0VGJY4', |
|
dennis_jeffrey
2011/12/01 02:44:56
add a space right after the ':' in each of the abo
rohitbm
2011/12/03 02:20:58
Done.
|
| + } |
| + 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 |
|
dennis_jeffrey
2011/12/01 02:44:56
I recommend removing the '_' character that's bein
rohitbm
2011/12/03 02:20:58
Done.
|
| + self._PrintSummaryResults(graph_description, dropped_fps, 'frames') |
|
dennis_jeffrey
2011/12/01 02:44:56
Note that this change gets rid of the old perf key
ilja
2011/12/01 04:13:06
If we already are renaming I would like all Flash
dennis_jeffrey
2011/12/01 18:15:33
I'd like to create a new perf report on the autote
rohitbm
2011/12/03 02:20:58
Sure, I will remove the old graphs before submitti
dennis_jeffrey
2011/12/05 18:09:24
I recommend waiting until we enable the new graphs
|
| def testYoutubeCPU(self): |
| """Measures the Youtube video CPU usage. Runs for 60 seconds. |