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

Side by Side Diff: functional/youtube.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 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 unified diff | Download patch | Annotate | Revision Log
« data/media/youtube_Avril.html ('K') | « functional/perf.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import re 6 import re
7 import time 7 import time
8 8
9 import pyauto_functional 9 import pyauto_functional
10 import pyauto 10 import pyauto
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 ytplayer.pauseVideo(); 114 ytplayer.pauseVideo();
115 window.domAutomationController.send(''); 115 window.domAutomationController.send('');
116 """) 116 """)
117 117
118 def AssertPlayingState(self): 118 def AssertPlayingState(self):
119 """Assert player's playing state.""" 119 """Assert player's playing state."""
120 self._pyauto.assertTrue(self._pyauto.WaitUntil(self._pyauto.GetPlayerState, 120 self._pyauto.assertTrue(self._pyauto.WaitUntil(self._pyauto.GetPlayerState,
121 expect_retval=self._pyauto.is_playing), 121 expect_retval=self._pyauto.is_playing),
122 msg='Player did not enter the playing state') 122 msg='Player did not enter the playing state')
123 123
124 def PlayVideoAndAssert(self): 124 def PlayVideoAndAssert(self, youtube_file='youtube.html'):
Nirnimesh 2011/12/01 00:03:14 why not pass the youtube video's URL as argument t
125 """Start video and assert the playing state.""" 125 """Start video and assert the playing state."""
126 self._pyauto.assertTrue(self._pyauto.IsFlashPluginEnabled(), 126 self._pyauto.assertTrue(self._pyauto.IsFlashPluginEnabled(),
127 msg='From here Flash plugin is disabled or not available') 127 msg='From here Flash plugin is disabled or not available')
128 url = self._pyauto.GetHttpURLForDataPath('media', 'youtube.html') 128 url = self._pyauto.GetHttpURLForDataPath('media', youtube_file)
129 self._pyauto.NavigateToURL(url) 129 self._pyauto.NavigateToURL(url)
130 self._pyauto.assertTrue(self._pyauto.WaitUntilPlayerReady(), 130 self._pyauto.assertTrue(self._pyauto.WaitUntilPlayerReady(),
131 msg='Failed to load YouTube player') 131 msg='Failed to load YouTube player')
132 self._pyauto.PlayVideo() 132 self._pyauto.PlayVideo()
133 self._pyauto.AssertPlayingState() 133 self._pyauto.AssertPlayingState()
134 134
135 135
136 class YoutubeTest(pyauto.PyUITest, YoutubeTestHelper): 136 class YoutubeTest(pyauto.PyUITest, YoutubeTestHelper):
137 """Test case for Youtube videos.""" 137 """Test case for Youtube videos."""
138 138
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 break 198 break
199 loaded_bytes = self.GetVideoLoadedBytes() 199 loaded_bytes = self.GetVideoLoadedBytes()
200 self.assertTrue(prev_loaded_bytes <= loaded_bytes) 200 self.assertTrue(prev_loaded_bytes <= loaded_bytes)
201 prev_loaded_bytes = loaded_bytes 201 prev_loaded_bytes = loaded_bytes
202 # Give some time to load a video 202 # Give some time to load a video
203 time.sleep(1) 203 time.sleep(1)
204 204
205 205
206 if __name__ == '__main__': 206 if __name__ == '__main__':
207 pyauto_functional.Main() 207 pyauto_functional.Main()
OLDNEW
« data/media/youtube_Avril.html ('K') | « functional/perf.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698