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

Unified Diff: chrome/test/functional/media/media_test_base.py

Issue 7322015: Add another test terminate condition in media perf test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modification based on CR comments. Created 9 years, 5 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/media/media_test_base.py
diff --git a/chrome/test/functional/media/media_test_base.py b/chrome/test/functional/media/media_test_base.py
index 93cc5652fe61e898724e686324d8454f69df3b4d..9d215650530d26a398d1571c2c002eca6a39fe14 100755
--- a/chrome/test/functional/media/media_test_base.py
+++ b/chrome/test/functional/media/media_test_base.py
@@ -126,15 +126,18 @@ class MediaTestBase(pyauto.PyUITest):
def ExecuteTest(self):
"""Test HTML5 Media Tag."""
- def _VideoEnded():
- """Determine if the video ended.
+ def _VideoEndedOrErrorOut():
+ """Determine if the video ended or there was an error when playing.
- When the video has finished playing, its title is updated by player.html.
+ When the video has finished playing or there is error in playing the
+ video (e.g, the video cannot be found), its title is updated by
+ player.html.
Returns:
- True if the video has ended.
+ True if the video has ended or an error occurred.
"""
- return self.GetDOMValue('document.title').strip() == 'END'
+ return (self.GetDOMValue('document.title').strip() == 'END' or
+ 'ERROR' in self.GetDOMValue('document.title'))
self.PreAllRunsProcess()
for run_counter in range(self.number_of_runs):
@@ -145,7 +148,7 @@ class MediaTestBase(pyauto.PyUITest):
url += '&actions=' + self.whole_test_scenarios[run_counter]
logging.debug('Navigate to %s', url)
self.NavigateToURL(url)
- self.WaitUntil(lambda: _VideoEnded(),
+ self.WaitUntil(lambda: _VideoEndedOrErrorOut(),
self.TIMEOUT)
self.PostEachRunProcess(run_counter)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698