Chromium Code Reviews| 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..adaf146818350fdfc9619f150e278c9abe564d48 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(): |
| + def _VideoEndedOrErrorOut(): |
| """Determine if the video ended. |
|
dennis_jeffrey
2011/07/07 19:45:21
add something like this: '...or there was an error
imasaki1
2011/07/07 20:42:05
Done.
|
| - 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 error out. |
|
dennis_jeffrey
2011/07/07 19:45:21
'error out' --> 'an error occurred'
imasaki1
2011/07/07 20:42:05
Done.
|
| """ |
| - return self.GetDOMValue('document.title').strip() == 'END' |
| + return self.GetDOMValue('document.title').strip() == 'END' or ( |
| + 'ERROR' in self.GetDOMValue('document.title')) |
|
dennis_jeffrey
2011/07/07 19:45:21
Recommend using parens like this:
return (self.Ge
imasaki1
2011/07/07 20:42:05
Done.
|
| 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) |