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

Unified Diff: chrome/test/data/media/html/media_basic_playback.html

Issue 9233046: Bug fixes for basic playback test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes. Created 8 years, 11 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 | chrome/test/functional/media/media_basic_playback.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/media/html/media_basic_playback.html
diff --git a/chrome/test/data/media/html/media_basic_playback.html b/chrome/test/data/media/html/media_basic_playback.html
index f5df358f0e90cd146080c819b0707720d96c53d4..88cf79561191cecb7b8590ac612bec89c2c20535 100644
--- a/chrome/test/data/media/html/media_basic_playback.html
+++ b/chrome/test/data/media/html/media_basic_playback.html
@@ -14,24 +14,30 @@
var video = document.querySelector('video');
// Used to keep track of events.
- var events = [];
+ var events;
+
+ // List of events to log. Events in this list are those which are expected
+ // plus those which are unexpected and will have a negative impact on
+ // playback.
+ var eventsToLog = [
+ 'abort', 'emptied', 'error', 'playing', 'stalled', 'suspend', 'waiting'];
function logEvent(evt) {
events.push(evt.type);
}
+ for(var i = 0; i < eventsToLog.length; i++)
+ video.addEventListener(eventsToLog[i], logEvent, false);
+
video.addEventListener('ended', function(event) {
firstEndedEvent = events.indexOf('ended') < 0;
logEvent(event);
- // At the end of the first playback, seek near end and replay.
+ // At the end of the first playback, seek near end and replay. 0.8 was
+ // chosen arbitrarily.
if (firstEndedEvent) {
video.currentTime = 0.8 * video.duration;
- video.play();
} else {
- // PyAuto has trouble with arrays, so convert to string.
- events = events.join(',');
-
// Notify PyAuto that we've completed testing. Send test of currentTime
// at the same time for efficiency.
window.domAutomationController.send(
@@ -39,13 +45,14 @@
}
}, false);
- video.addEventListener('playing', logEvent, false);
- video.addEventListener('error', logEvent, false);
- video.addEventListener('abort', logEvent, false);
- video.addEventListener('seeked', logEvent, false);
+ video.addEventListener('seeked', function(event) {
+ logEvent(event);
+ video.play();
+ }, false);
- // Retrieve video file name from URL query parameters. See utils.js.
- video.src = '../' + QueryString.media;
- video.play();
+ function startTest(media) {
+ events = [];
+ video.src = '../' + media;
+ }
</script>
</html>
« no previous file with comments | « no previous file | chrome/test/functional/media/media_basic_playback.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698