summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-07 20:44:12 +0000
committerimasaki@google.com <imasaki@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-07 20:44:12 +0000
commitf3d5a44568be26375eac9daa7c1a69e36ea6f1bf (patch)
tree09b3cbdb204406631eeaf3ec902aff21e2dac6d1
parentce2eb355b9b19c7f14bb8c672f0b86c2d3dcb058 (diff)
downloadchromium_src-f3d5a44568be26375eac9daa7c1a69e36ea6f1bf.zip
chromium_src-f3d5a44568be26375eac9daa7c1a69e36ea6f1bf.tar.gz
chromium_src-f3d5a44568be26375eac9daa7c1a69e36ea6f1bf.tar.bz2
Add another test terminate condition in media perf test. This is to catch the video playing error as early as possible (rather than waiting for timeout). This will prevent my script from occupying buildbot.
Review URL: http://codereview.chromium.org/7322015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91746 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/test/functional/media/media_test_base.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/chrome/test/functional/media/media_test_base.py b/chrome/test/functional/media/media_test_base.py
index 93cc565..9d21565 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)