<video preload> testsuite

This testsuite tests preload attribute of <audio> and <video> elements.
The specification can be found at http://www.w3.org/TR/html5/video.html#attr-media-preload.

Where applicable, tests are written for four media formats:

  1. WAVE as data: URL: The WAVE file that is used consists of two samples of silence.
  2. MPEG-4: preload.mp4, size: 494,180 bytes, duration: 1 minute
  3. Ogg: preload.ogv, size: 493,444 bytes, duration: 1 minute
  4. WebM: preload.webm, size: 494,132 bytes, duration: 1 minute
Note:

1. <video preload="auto">

TCDescription
preload-auto-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [Webm]
Simple event order check. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )*canplaythrough $/
/^loadstart progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.
preload-auto-to-none-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to none after loadstart. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )*canplaythrough $/
/^loadstart progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.
preload-auto-to-metadata-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to metadata after loadstart. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )*canplaythrough $/
/^loadstart progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.

2. <video preload="metadata">

TCDescription
preload-metadata-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple event order check. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend $/
/^loadstart progress loadedmetadata loadeddata suspend $/ for data: URL test.
preload-metadata-event-order-play-after-suspend
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when play is called after suspend. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend (progress )*canplay (progress )*canplaythrough $/
/^loadstart progress loadedmetadata loadeddata suspend canplay canplaythrough $/ for data: URL test.
preload-metadata-networkstate-after-suspend
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple networkState check after suspend. Should be NETWORK_IDLE.
preload-metadata-readystate-after-suspend
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple readyState check after suspend. Should be HAVE_CURRENT_DATA.
preload-metadata-to-none-after-loadstart-networkstate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple networkState check when preload is set to none after loadstart. Should be NETWORK_IDLE.
preload-metadata-to-none-after-loadstart-readystate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple readyState check when preload is set to none after loadstart. Should be HAVE_CURRENT_DATA.
preload-metadata-to-none-after-src-networkstate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple networkState check when preload is set to none after src is set. Should be NETWORK_IDLE.
preload-metadata-to-none-after-src-readystate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple readyState check when preload is set to none after src is set. Should be HAVE_NOTHING.
preload-metadata-to-none-before-src-readystate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple readyState check when preload is set to none before src is set. Should be HAVE_NOTHING.
preload-metadata-to-none-after-source-readystate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple readyState check when preload is set to none after a source element is appended. Should be HAVE_NOTHING.
preload-metadata-to-none-before-source-readystate
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple readyState check when preload is set to none before a source element is appended. Should be HAVE_NOTHING.
preload-metadata-buffered
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple 'buffered' check. Should have start of the media (for Ogg the end should be buffered as well).
preload-metadata-to-auto-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to auto after suspend. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend (progress )*canplay (progress )*canplaythrough $/
/^loadstart progress loadedmetadata loadeddata suspend canplay canplaythrough $/ for data: URL test.
preload-metadata-to-none-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to none after loadstart. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend $/
/^loadstart progress loadedmetadata loadeddata suspend $/ for data: URL test.

3. <video preload="none">

TCDescription
preload-none-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple event order check. Expected event order:
/^loadstart suspend $/
preload-none-event-order-autoplay
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when autoplay is set before loadstart. Expected event order:
/^loadstart (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )* canplaythrough $/
/^loadstart progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.
preload-none-event-order-autoplay-after-suspend
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when autoplay is set after suspend. Expected event order:
/^loadstart suspend (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )*canplaythrough $/
/^loadstart suspend progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.
preload-none-event-order-play-after-suspend
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when play is called after suspend. Expected event order:
/^loadstart suspend (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )*canplaythrough $/
/^loadstart suspend progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.
preload-none-event-order-poster-delayed.html 'window' load should be delayed for the poster to load
preload-none-buffered
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Simple 'buffered' check (Should be empty).
preload-none-to-auto-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to auto after suspend. Expected event order:
/^loadstart suspend (progress )+loadedmetadata (progress )*loadeddata (progress )*canplay (progress )*canplaythrough $/
/^loadstart suspend progress loadedmetadata loadeddata canplay canplaythrough $/ for data: URL test.
preload-none-to-invalid-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to an invalid value after suspend. Expected event order:
/^loadstart suspend (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend $/
/^loadstart suspend progress loadedmetadata loadeddata suspend $/ for data: URL test.
preload-none-to-metadata-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to metadata after suspend. Expected event order:
/^loadstart suspend (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend $/
/^loadstart suspend progress loadedmetadata loadeddata suspend $/ for data: URL test.
preload-none-remove-attribute-event-order
[WAVE as data: URL] [MPEG-4] [Ogg] [WebM]
Event order when preload is set to metadata after suspend. Expected event order:
/^loadstart suspend (progress )+loadedmetadata (progress )*loadeddata (progress )*suspend $/
/^loadstart suspend progress loadedmetadata loadeddata suspend $/ for data: URL test.
preload-none-poster
[test] [reference]
Poster should load when preload="none" (test type: reftest).