def run_youtube_tests(self, browser): """Run YouTube HTML5 sanity tests. @param browser: The Browser object to run the test with. """ tab = browser.tabs[0] tab.Navigate('http://localhost:8000/youtube5.html') yh = youtube_helper.YouTubeHelper(tab, power_logging=True) # Waiting for test video to load. yh.wait_for_player_state(PLAYER_PLAYING_STATE) # Set tiny resolution to prevent inadvertently caching a higher # bandwidth stream which taints resolution verification. yh.set_playback_quality('tiny') yh.set_video_duration() # Verify that YouTube is running in html5 mode. prc = utils.get_process_list('chrome', '--type=ppapi( |$)') if prc: raise error.TestFail('Running YouTube in Flash mode. ' 'Process list: %s.' % prc) tab.ExecuteJavaScript('player.mute()') yh.verify_video_playback() yh.verify_video_resolutions(power_measurement=True) yh.verify_player_states() self.rapl_rate = yh.get_power_measurement()
def run_video_tests(self, browser): """Play youtube html5 and a local video, and verify the playback. @param browser: The Browser object to run the test with. """ browser.platform.SetHTTPServerDirectories(self.bindir) tab1 = browser.tabs.New() # Verifying <video> support. tab1.Navigate( browser.platform.http_server.UrlOf( os.path.join(self.bindir, 'video.html'))) # Waiting for test video to load. tab1.WaitForJavaScriptCondition('testvideo.currentTime < 1.0', timeout=5) tab2 = browser.tabs.New() tab2.Navigate( browser.platform.http_server.UrlOf( os.path.join(self.bindir, 'youtube5.html'))) yh = youtube_helper.YouTubeHelper(tab2) # Waiting for test video to load. yh.wait_for_player_state(PLAYER_PLAYING_STATE) yh.set_video_duration() # Verify that YouTube is running in html5 mode. prc = utils.get_process_list('chrome', '--type=ppapi') if prc: raise error.TestFail('Tab2: Running YouTube in Flash mode.') # Verifying video playback. self.verify_localvideo_playback(tab1) yh.verify_video_playback()
def run_youtube_tests(self, browser): """Run YouTube Flash sanity tests. @param browser: The Browser object to run the test with. """ tab = browser.tabs[0] tab.Navigate('http://localhost:8000/youtube.html') yh = youtube_helper.YouTubeHelper(tab) # Waiting for test video to load. yh.wait_for_player_state(PLAYER_PLAYING_STATE) yh.set_video_duration() # Verify that YouTube is running in Flash mode. prc = utils.get_process_list('chrome', '--type=ppapi( |$)') if not prc: raise error.TestFail('No Flash process is running.') tab.ExecuteJavaScript('player.mute()') yh.verify_video_playback() yh.verify_video_resolutions() yh.verify_player_states()