Permalink
Browse files

Merge pull request #8 from facebook/video

Adding video test.
NOTE: doesn't test enough, assumes a bunch of codecs
  • Loading branch information...
2 parents 4a23706 + 9caad7a commit ca1bb0bb3fe6a0c1db4fefd8ae1c6cd49f828cd2 @darobin darobin committed Jun 8, 2012
Showing with 35 additions and 0 deletions.
  1. +5 −0 tests/video/config.yml
  2. +30 −0 tests/video/test.js
View
@@ -0,0 +1,5 @@
+---
+ r: 0
+ spec: "http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html"
+ sources: ["http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#the-source-element"]
+ title: "Video"
View
@@ -0,0 +1,30 @@
+test("Video", function() {
+ var video = document.createElement("video");
+
+ assert( !!video.canPlayType, "video supported" );
+});
+
+test("Video Codec: mp4/MPEG-4", function() {
+ var video = document.createElement("video");
+
+ assert( video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.8"') !== "no", 'MPEG-4 supported (codecs="avc1.42E01E, mp4a.40.8")' );
+});
+
+
+test("Video Codec: mp4/H.264", function() {
+ var video = document.createElement("video");
+
+ assert( video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') !== "no", 'H.264 supported (codecs="avc1.42E01E, mp4a.40.2")' );
+ assert( video.canPlayType('video/mp4; codecs="avc1.42E01E"') !== "no", 'H.264 supported (codecs="avc1.42E01E")' );
+});
+
+test("Video Codec: ogg", function() {
+ var video = document.createElement("video");
+ assert( video.canPlayType('video/ogg; codecs="theora"') !== "no", 'OGG supported (codecs="theora")' );
+});
+
+test("Video Codec: WebM", function() {
+ var video = document.createElement("video");
+ assert( video.canPlayType('video/webm; codecs="vp8, vorbis"') !== "no", 'WebM supported (codecs="vp8, vorbis")' );
+ assert( video.canPlayType('video/webm; codecs="vp8"') !== "no", 'WebM supported (codecs="vp8")' );
+});

0 comments on commit ca1bb0b

Please sign in to comment.