Reviewed by Maciej.
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2007 02:35:53 +0000 (02:35 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2007 02:35:53 +0000 (02:35 +0000)
        Media tests from feature branch.

        * fast/dom/Window/window-properties-expected.txt: Replaced.
        * fast/dom/Window/window-properties.html: Replaced.
        * media: Added.
        * media/audio-constructor-expected.txt: Added.
        * media/audio-constructor-src-expected.txt: Added.
        * media/audio-constructor-src.html: Added.
        * media/audio-constructor.html: Added.
        * media/content: Added.
        * media/content/test.mp4: Added.
        * media/content/test.wav: Added.
        * media/progress-event-expected.txt: Added.
        * media/progress-event.html: Added.
        * media/video-append-source-expected.txt: Added.
        * media/video-append-source.html: Added.
        * media/video-autoplay-expected.txt: Added.
        * media/video-autoplay.html: Added.
        * media/video-buffered-expected.txt: Added.
        * media/video-buffered.html: Added.
        * media/video-cuepoint-add-expected.txt: Added.
        * media/video-cuepoint-add.html: Added.
        * media/video-cuepoint-multiple-expected.txt: Added.
        * media/video-cuepoint-multiple.html: Added.
        * media/video-cuepoint-pause-expected.txt: Added.
        * media/video-cuepoint-pause.html: Added.
        * media/video-cuepoint-remove-expected.txt: Added.
        * media/video-cuepoint-remove-multiple-expected.txt: Added.
        * media/video-cuepoint-remove-multiple.html: Added.
        * media/video-cuepoint-remove.html: Added.
        * media/video-currentTime-expected.txt: Added.
        * media/video-currentTime-set-expected.txt: Added.
        * media/video-currentTime-set.html: Added.
        * media/video-currentTime-set2-expected.txt: Added.
        * media/video-currentTime-set2.html: Added.
        * media/video-currentTime.html: Added.
        * media/video-dom-autoplay-expected.txt: Added.
        * media/video-dom-autoplay.html: Added.
        * media/video-dom-end-expected.txt: Added.
        * media/video-dom-end.html: Added.
        * media/video-dom-loopcount-expected.txt: Added.
        * media/video-dom-loopcount.html: Added.
        * media/video-dom-loopend-expected.txt: Added.
        * media/video-dom-loopend.html: Added.
        * media/video-dom-loopstart-expected.txt: Added.
        * media/video-dom-loopstart.html: Added.
        * media/video-dom-src-expected.txt: Added.
        * media/video-dom-src.html: Added.
        * media/video-dom-start-expected.txt: Added.
        * media/video-dom-start.html: Added.
        * media/video-end-expected.txt: Added.
        * media/video-end.html: Added.
        * media/video-error-abort-expected.txt: Added.
        * media/video-error-abort.html: Added.
        * media/video-error-does-not-exist-expected.txt: Added.
        * media/video-error-does-not-exist.html: Added.
        * media/video-load-networkState-expected.txt: Added.
        * media/video-load-networkState.html: Added.
        * media/video-load-readyState-expected.txt: Added.
        * media/video-load-readyState.html: Added.
        * media/video-loopcount-expected.txt: Added.
        * media/video-loopcount.html: Added.
        * media/video-loopend-expected.txt: Added.
        * media/video-loopend.html: Added.
        * media/video-loopstart-expected.txt: Added.
        * media/video-loopstart.html: Added.
        * media/video-muted-expected.txt: Added.
        * media/video-muted.html: Added.
        * media/video-no-autoplay-expected.txt: Added.
        * media/video-no-autoplay.html: Added.
        * media/video-seekable-expected.txt: Added.
        * media/video-seekable.html: Added.
        * media/video-size-expected.txt: Added.
        * media/video-size.html: Added.
        * media/video-source-expected.txt: Added.
        * media/video-source-media-expected.txt: Added.
        * media/video-source-media.html: Added.
        * media/video-source-type-expected.txt: Added.
        * media/video-source-type.html: Added.
        * media/video-source.html: Added.
        * media/video-src-expected.txt: Added.
        * media/video-src-source-expected.txt: Added.
        * media/video-src-source.html: Added.
        * media/video-src.html: Added.
        * media/video-start-expected.txt: Added.
        * media/video-start.html: Added.
        * media/video-test.js: Added.
        * media/video-volume-expected.txt: Added.
        * media/video-volume.html: Added.
        * platform/qt/Skipped:
        * platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27286 268f45cc-cd09-0410-ab3c-d52691b4dbfc

87 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/window-properties-expected.txt
LayoutTests/media/audio-constructor-expected.txt [new file with mode: 0644]
LayoutTests/media/audio-constructor-src-expected.txt [new file with mode: 0644]
LayoutTests/media/audio-constructor-src.html [new file with mode: 0644]
LayoutTests/media/audio-constructor.html [new file with mode: 0644]
LayoutTests/media/content/test.mp4 [new file with mode: 0644]
LayoutTests/media/content/test.wav [new file with mode: 0644]
LayoutTests/media/progress-event-expected.txt [new file with mode: 0644]
LayoutTests/media/progress-event.html [new file with mode: 0644]
LayoutTests/media/video-append-source-expected.txt [new file with mode: 0644]
LayoutTests/media/video-append-source.html [new file with mode: 0644]
LayoutTests/media/video-autoplay-expected.txt [new file with mode: 0644]
LayoutTests/media/video-autoplay.html [new file with mode: 0644]
LayoutTests/media/video-buffered-expected.txt [new file with mode: 0644]
LayoutTests/media/video-buffered.html [new file with mode: 0644]
LayoutTests/media/video-cuepoint-add-expected.txt [new file with mode: 0644]
LayoutTests/media/video-cuepoint-add.html [new file with mode: 0644]
LayoutTests/media/video-cuepoint-multiple-expected.txt [new file with mode: 0644]
LayoutTests/media/video-cuepoint-multiple.html [new file with mode: 0644]
LayoutTests/media/video-cuepoint-pause-expected.txt [new file with mode: 0644]
LayoutTests/media/video-cuepoint-pause.html [new file with mode: 0644]
LayoutTests/media/video-cuepoint-remove-expected.txt [new file with mode: 0644]
LayoutTests/media/video-cuepoint-remove-multiple-expected.txt [new file with mode: 0644]
LayoutTests/media/video-cuepoint-remove-multiple.html [new file with mode: 0644]
LayoutTests/media/video-cuepoint-remove.html [new file with mode: 0644]
LayoutTests/media/video-currentTime-expected.txt [new file with mode: 0644]
LayoutTests/media/video-currentTime-set-expected.txt [new file with mode: 0644]
LayoutTests/media/video-currentTime-set.html [new file with mode: 0644]
LayoutTests/media/video-currentTime-set2-expected.txt [new file with mode: 0644]
LayoutTests/media/video-currentTime-set2.html [new file with mode: 0644]
LayoutTests/media/video-currentTime.html [new file with mode: 0644]
LayoutTests/media/video-dom-autoplay-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-autoplay.html [new file with mode: 0644]
LayoutTests/media/video-dom-end-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-end.html [new file with mode: 0644]
LayoutTests/media/video-dom-loopcount-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-loopcount.html [new file with mode: 0644]
LayoutTests/media/video-dom-loopend-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-loopend.html [new file with mode: 0644]
LayoutTests/media/video-dom-loopstart-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-loopstart.html [new file with mode: 0644]
LayoutTests/media/video-dom-src-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-src.html [new file with mode: 0644]
LayoutTests/media/video-dom-start-expected.txt [new file with mode: 0644]
LayoutTests/media/video-dom-start.html [new file with mode: 0644]
LayoutTests/media/video-end-expected.txt [new file with mode: 0644]
LayoutTests/media/video-end.html [new file with mode: 0644]
LayoutTests/media/video-error-abort-expected.txt [new file with mode: 0644]
LayoutTests/media/video-error-abort.html [new file with mode: 0644]
LayoutTests/media/video-error-does-not-exist-expected.txt [new file with mode: 0644]
LayoutTests/media/video-error-does-not-exist.html [new file with mode: 0644]
LayoutTests/media/video-load-networkState-expected.txt [new file with mode: 0644]
LayoutTests/media/video-load-networkState.html [new file with mode: 0644]
LayoutTests/media/video-load-readyState-expected.txt [new file with mode: 0644]
LayoutTests/media/video-load-readyState.html [new file with mode: 0644]
LayoutTests/media/video-loopcount-expected.txt [new file with mode: 0644]
LayoutTests/media/video-loopcount.html [new file with mode: 0644]
LayoutTests/media/video-loopend-expected.txt [new file with mode: 0644]
LayoutTests/media/video-loopend.html [new file with mode: 0644]
LayoutTests/media/video-loopstart-expected.txt [new file with mode: 0644]
LayoutTests/media/video-loopstart.html [new file with mode: 0644]
LayoutTests/media/video-muted-expected.txt [new file with mode: 0644]
LayoutTests/media/video-muted.html [new file with mode: 0644]
LayoutTests/media/video-no-autoplay-expected.txt [new file with mode: 0644]
LayoutTests/media/video-no-autoplay.html [new file with mode: 0644]
LayoutTests/media/video-seekable-expected.txt [new file with mode: 0644]
LayoutTests/media/video-seekable.html [new file with mode: 0644]
LayoutTests/media/video-size-expected.txt [new file with mode: 0644]
LayoutTests/media/video-size.html [new file with mode: 0644]
LayoutTests/media/video-source-expected.txt [new file with mode: 0644]
LayoutTests/media/video-source-media-expected.txt [new file with mode: 0644]
LayoutTests/media/video-source-media.html [new file with mode: 0644]
LayoutTests/media/video-source-type-expected.txt [new file with mode: 0644]
LayoutTests/media/video-source-type.html [new file with mode: 0644]
LayoutTests/media/video-source.html [new file with mode: 0644]
LayoutTests/media/video-src-expected.txt [new file with mode: 0644]
LayoutTests/media/video-src-source-expected.txt [new file with mode: 0644]
LayoutTests/media/video-src-source.html [new file with mode: 0644]
LayoutTests/media/video-src.html [new file with mode: 0644]
LayoutTests/media/video-start-expected.txt [new file with mode: 0644]
LayoutTests/media/video-start.html [new file with mode: 0644]
LayoutTests/media/video-test.js [new file with mode: 0644]
LayoutTests/media/video-volume-expected.txt [new file with mode: 0644]
LayoutTests/media/video-volume.html [new file with mode: 0644]
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped

index 49e0891..e230798 100644 (file)
@@ -1,3 +1,99 @@
+2007-10-29  Antti Koivisto  <antti@apple.com>
+
+        Reviewed by Maciej.
+        
+        Media tests from feature branch.
+
+        * fast/dom/Window/window-properties-expected.txt: Replaced.
+        * fast/dom/Window/window-properties.html: Replaced.
+        * media: Added.
+        * media/audio-constructor-expected.txt: Added.
+        * media/audio-constructor-src-expected.txt: Added.
+        * media/audio-constructor-src.html: Added.
+        * media/audio-constructor.html: Added.
+        * media/content: Added.
+        * media/content/test.mp4: Added.
+        * media/content/test.wav: Added.
+        * media/progress-event-expected.txt: Added.
+        * media/progress-event.html: Added.
+        * media/video-append-source-expected.txt: Added.
+        * media/video-append-source.html: Added.
+        * media/video-autoplay-expected.txt: Added.
+        * media/video-autoplay.html: Added.
+        * media/video-buffered-expected.txt: Added.
+        * media/video-buffered.html: Added.
+        * media/video-cuepoint-add-expected.txt: Added.
+        * media/video-cuepoint-add.html: Added.
+        * media/video-cuepoint-multiple-expected.txt: Added.
+        * media/video-cuepoint-multiple.html: Added.
+        * media/video-cuepoint-pause-expected.txt: Added.
+        * media/video-cuepoint-pause.html: Added.
+        * media/video-cuepoint-remove-expected.txt: Added.
+        * media/video-cuepoint-remove-multiple-expected.txt: Added.
+        * media/video-cuepoint-remove-multiple.html: Added.
+        * media/video-cuepoint-remove.html: Added.
+        * media/video-currentTime-expected.txt: Added.
+        * media/video-currentTime-set-expected.txt: Added.
+        * media/video-currentTime-set.html: Added.
+        * media/video-currentTime-set2-expected.txt: Added.
+        * media/video-currentTime-set2.html: Added.
+        * media/video-currentTime.html: Added.
+        * media/video-dom-autoplay-expected.txt: Added.
+        * media/video-dom-autoplay.html: Added.
+        * media/video-dom-end-expected.txt: Added.
+        * media/video-dom-end.html: Added.
+        * media/video-dom-loopcount-expected.txt: Added.
+        * media/video-dom-loopcount.html: Added.
+        * media/video-dom-loopend-expected.txt: Added.
+        * media/video-dom-loopend.html: Added.
+        * media/video-dom-loopstart-expected.txt: Added.
+        * media/video-dom-loopstart.html: Added.
+        * media/video-dom-src-expected.txt: Added.
+        * media/video-dom-src.html: Added.
+        * media/video-dom-start-expected.txt: Added.
+        * media/video-dom-start.html: Added.
+        * media/video-end-expected.txt: Added.
+        * media/video-end.html: Added.
+        * media/video-error-abort-expected.txt: Added.
+        * media/video-error-abort.html: Added.
+        * media/video-error-does-not-exist-expected.txt: Added.
+        * media/video-error-does-not-exist.html: Added.
+        * media/video-load-networkState-expected.txt: Added.
+        * media/video-load-networkState.html: Added.
+        * media/video-load-readyState-expected.txt: Added.
+        * media/video-load-readyState.html: Added.
+        * media/video-loopcount-expected.txt: Added.
+        * media/video-loopcount.html: Added.
+        * media/video-loopend-expected.txt: Added.
+        * media/video-loopend.html: Added.
+        * media/video-loopstart-expected.txt: Added.
+        * media/video-loopstart.html: Added.
+        * media/video-muted-expected.txt: Added.
+        * media/video-muted.html: Added.
+        * media/video-no-autoplay-expected.txt: Added.
+        * media/video-no-autoplay.html: Added.
+        * media/video-seekable-expected.txt: Added.
+        * media/video-seekable.html: Added.
+        * media/video-size-expected.txt: Added.
+        * media/video-size.html: Added.
+        * media/video-source-expected.txt: Added.
+        * media/video-source-media-expected.txt: Added.
+        * media/video-source-media.html: Added.
+        * media/video-source-type-expected.txt: Added.
+        * media/video-source-type.html: Added.
+        * media/video-source.html: Added.
+        * media/video-src-expected.txt: Added.
+        * media/video-src-source-expected.txt: Added.
+        * media/video-src-source.html: Added.
+        * media/video-src.html: Added.
+        * media/video-start-expected.txt: Added.
+        * media/video-start.html: Added.
+        * media/video-test.js: Added.
+        * media/video-volume-expected.txt: Added.
+        * media/video-volume.html: Added.
+        * platform/qt/Skipped:
+        * platform/win/Skipped:
+
 2007-10-30  Justin Garcia  <set EMAIL_ADDRESS environment variable>
 
         Reviewed by Darin Adler.
index d869899..fa90447 100644 (file)
@@ -32,6 +32,7 @@ window.Attr.prototype.normalize [function]
 window.Attr.prototype.removeChild [function]
 window.Attr.prototype.removeEventListener [function]
 window.Attr.prototype.replaceChild [function]
+window.Audio [object Object]
 window.CDATASection [object CDATASectionConstructor]
 window.CDATASection.prototype [object CDATASectionPrototype]
 window.CDATASection.prototype.ATTRIBUTE_NODE [number]
@@ -558,6 +559,17 @@ window.HTMLAppletElement [object HTMLAppletElementConstructor]
 window.HTMLAppletElement.prototype [printed above as window.Element.prototype]
 window.HTMLAreaElement [object HTMLAreaElementConstructor]
 window.HTMLAreaElement.prototype [printed above as window.Element.prototype]
+window.HTMLAudioElement [object HTMLMediaElementConstructor]
+window.HTMLAudioElement.CAN_PLAY [number]
+window.HTMLAudioElement.CAN_PLAY_THROUGH [number]
+window.HTMLAudioElement.CAN_SHOW_CURRENT_FRAME [number]
+window.HTMLAudioElement.DATA_UNAVAILABLE [number]
+window.HTMLAudioElement.EMPTY [number]
+window.HTMLAudioElement.LOADED [number]
+window.HTMLAudioElement.LOADED_FIRST_FRAME [number]
+window.HTMLAudioElement.LOADED_METADATA [number]
+window.HTMLAudioElement.LOADING [number]
+window.HTMLAudioElement.prototype [printed above as window.Element.prototype]
 window.HTMLBRElement [object HTMLBRElementConstructor]
 window.HTMLBRElement.prototype [printed above as window.Element.prototype]
 window.HTMLBaseElement [object HTMLBaseElementConstructor]
@@ -622,6 +634,7 @@ window.HTMLMapElement [object HTMLMapElementConstructor]
 window.HTMLMapElement.prototype [printed above as window.Element.prototype]
 window.HTMLMarqueeElement [object HTMLMarqueeElementConstructor]
 window.HTMLMarqueeElement.prototype [printed above as window.Element.prototype]
+window.HTMLMediaElement [printed above as window.HTMLAudioElement]
 window.HTMLMenuElement [object HTMLMenuElementConstructor]
 window.HTMLMenuElement.prototype [printed above as window.Element.prototype]
 window.HTMLMetaElement [object HTMLMetaElementConstructor]
@@ -667,7 +680,17 @@ window.HTMLTitleElement [object HTMLTitleElementConstructor]
 window.HTMLTitleElement.prototype [printed above as window.Element.prototype]
 window.HTMLUListElement [object HTMLUListElementConstructor]
 window.HTMLUListElement.prototype [printed above as window.Element.prototype]
+window.HTMLVideoElement [object HTMLVideoElementConstructor]
+window.HTMLVideoElement.prototype [printed above as window.Element.prototype]
 window.Image [object Object]
+window.MediaError [object MediaErrorConstructor]
+window.MediaError.MEDIA_ERR_ABORTED [number]
+window.MediaError.MEDIA_ERR_DECODE [number]
+window.MediaError.MEDIA_ERR_NETWORK [number]
+window.MediaError.prototype [object MediaErrorPrototype]
+window.MediaError.prototype.MEDIA_ERR_ABORTED [number]
+window.MediaError.prototype.MEDIA_ERR_DECODE [number]
+window.MediaError.prototype.MEDIA_ERR_NETWORK [number]
 window.MediaList [object MediaListConstructor]
 window.MediaList.prototype [object MediaListPrototype]
 window.MediaList.prototype.appendMedium [function]
diff --git a/LayoutTests/media/audio-constructor-expected.txt b/LayoutTests/media/audio-constructor-expected.txt
new file mode 100644 (file)
index 0000000..8243223
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(audio instanceof HTMLAudioElement) OK
+EVENT(load) TEST(relativeURL(audio.currentSrc)=='content/test.wav') OK
+EVENT(play)
+END OF TEST
+
diff --git a/LayoutTests/media/audio-constructor-src-expected.txt b/LayoutTests/media/audio-constructor-src-expected.txt
new file mode 100644 (file)
index 0000000..8243223
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(audio instanceof HTMLAudioElement) OK
+EVENT(load) TEST(relativeURL(audio.currentSrc)=='content/test.wav') OK
+EVENT(play)
+END OF TEST
+
diff --git a/LayoutTests/media/audio-constructor-src.html b/LayoutTests/media/audio-constructor-src.html
new file mode 100644 (file)
index 0000000..8cb1256
--- /dev/null
@@ -0,0 +1,11 @@
+<body>
+<script src=video-test.js></script>
+<script>
+var audio = new Audio("content/test.wav");
+media = audio;
+
+test("audio instanceof HTMLAudioElement");
+waitForEventAndTest("load", "relativeURL(audio.currentSrc)=='content/test.wav'");
+waitForEventAndEnd("play");
+audio.play();
+</script>
diff --git a/LayoutTests/media/audio-constructor.html b/LayoutTests/media/audio-constructor.html
new file mode 100644 (file)
index 0000000..0ea531e
--- /dev/null
@@ -0,0 +1,12 @@
+<body>
+<script src=video-test.js></script>
+<script>
+var audio = new Audio();
+media = audio;
+
+test("audio instanceof HTMLAudioElement");
+waitForEventAndTest("load", "relativeURL(audio.currentSrc)=='content/test.wav'");
+waitForEventAndEnd("play");
+audio.src = "content/test.wav";
+audio.play();
+</script>
diff --git a/LayoutTests/media/content/test.mp4 b/LayoutTests/media/content/test.mp4
new file mode 100644 (file)
index 0000000..969d695
Binary files /dev/null and b/LayoutTests/media/content/test.mp4 differ
diff --git a/LayoutTests/media/content/test.wav b/LayoutTests/media/content/test.wav
new file mode 100644 (file)
index 0000000..e46e57d
Binary files /dev/null and b/LayoutTests/media/content/test.wav differ
diff --git a/LayoutTests/media/progress-event-expected.txt b/LayoutTests/media/progress-event-expected.txt
new file mode 100644 (file)
index 0000000..bf95d65
--- /dev/null
@@ -0,0 +1,4 @@
+EVENT(begin) TEST(!event.lengthComputable && event.loaded==0 && event.total==0) OK
+EVENT(load) TEST(event.lengthComputable && event.loaded>0 && event.total>0) OK
+END OF TEST
+
diff --git a/LayoutTests/media/progress-event.html b/LayoutTests/media/progress-event.html
new file mode 100644 (file)
index 0000000..a1499d0
--- /dev/null
@@ -0,0 +1,6 @@
+<video src="content/test.mp4"></video>
+<script src=video-test.js></script>
+<script>
+waitForEventAndTest("begin", "!event.lengthComputable && event.loaded==0 && event.total==0");
+waitForEventTestAndEnd("load", "event.lengthComputable && event.loaded>0 && event.total>0");
+</script>
diff --git a/LayoutTests/media/video-append-source-expected.txt b/LayoutTests/media/video-append-source-expected.txt
new file mode 100644 (file)
index 0000000..39ab3fa
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.currentSrc=='') OK
+TEST(video.currentSrc=='') OK
+EVENT(load) TEST(relativeURL(video.currentSrc)=='content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-append-source.html b/LayoutTests/media/video-append-source.html
new file mode 100644 (file)
index 0000000..579f383
--- /dev/null
@@ -0,0 +1,10 @@
+<video></video>
+<script src=video-test.js></script>
+<script>
+test("video.currentSrc==''");
+var source = document.createElement("source");
+source.setAttribute("src", "content/test.mp4");
+video.appendChild(source);
+test("video.currentSrc==''");
+waitForEventTestAndEnd("load", "relativeURL(video.currentSrc)=='content/test.mp4'");
+</script>
diff --git a/LayoutTests/media/video-autoplay-expected.txt b/LayoutTests/media/video-autoplay-expected.txt
new file mode 100644 (file)
index 0000000..022df61
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.autoplay) OK
+TEST(video.getAttribute('autoplay') != null) OK
+EVENT(play) TEST(!video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-autoplay.html b/LayoutTests/media/video-autoplay.html
new file mode 100644 (file)
index 0000000..b52710f
--- /dev/null
@@ -0,0 +1,7 @@
+<video src=content/test.mp4 autoplay></video>
+<script src=video-test.js></script>
+<script>
+test("video.autoplay");
+test("video.getAttribute('autoplay') != null");
+waitForEventTestAndEnd('play', "!video.paused");
+</script>
diff --git a/LayoutTests/media/video-buffered-expected.txt b/LayoutTests/media/video-buffered-expected.txt
new file mode 100644 (file)
index 0000000..7fe4dae
--- /dev/null
@@ -0,0 +1,15 @@
+TEST(video.buffered.length == 0) OK
+TEST(video.buffered.start(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.buffered.end(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.buffered.start(0)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.buffered.end(0)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+EVENT(load)
+TEST(video.buffered.length == 1) OK
+TEST(video.buffered.start(0) == 0) OK
+TEST(video.buffered.end(0) > 0) OK
+TEST(video.buffered.start(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.buffered.end(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.buffered.start(1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.buffered.end(1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-buffered.html b/LayoutTests/media/video-buffered.html
new file mode 100644 (file)
index 0000000..324508a
--- /dev/null
@@ -0,0 +1,22 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.buffered.length == 0");
+testException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
+testException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
+testException("video.buffered.start(0)", "DOMException.INDEX_SIZE_ERR");
+testException("video.buffered.end(0)", "DOMException.INDEX_SIZE_ERR");
+waitForEvent('load', 
+    function () 
+    {
+        test("video.buffered.length == 1");
+        test("video.buffered.start(0) == 0");
+        test("video.buffered.end(0) > 0");
+        testException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
+        testException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
+        testException("video.buffered.start(1)", "DOMException.INDEX_SIZE_ERR");
+        testException("video.buffered.end(1)", "DOMException.INDEX_SIZE_ERR");
+        endTest();
+    }
+);
+</script>
diff --git a/LayoutTests/media/video-cuepoint-add-expected.txt b/LayoutTests/media/video-cuepoint-add-expected.txt
new file mode 100644 (file)
index 0000000..6a81335
--- /dev/null
@@ -0,0 +1,8 @@
+TEST(video.currentTime.toFixed(1) == 0.2) OK
+TEST(!video.paused) OK
+TEST(video.currentTime.toFixed(1) == 0.4) OK
+TEST(!video.paused) OK
+TEST(video.currentTime.toFixed(1) == 0) OK
+TEST(!video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-cuepoint-add.html b/LayoutTests/media/video-cuepoint-add.html
new file mode 100644 (file)
index 0000000..f21ebf6
--- /dev/null
@@ -0,0 +1,22 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+function cueHit1() {
+    test("video.currentTime.toFixed(1) == 0.2");
+    test("!video.paused");    
+}
+function cueHit2() {
+    test("video.currentTime.toFixed(1) == 0.4");
+    test("!video.paused");    
+    video.currentTime = 0;
+}
+function cueHit0() {
+    test("video.currentTime.toFixed(1) == 0");
+    test("!video.paused");    
+    endTest();
+}
+video.addCuePoint(0.2, cueHit1);
+video.addCuePoint(0.4, cueHit2);
+video.addCuePoint(0, cueHit0);
+video.play();
+</script>
diff --git a/LayoutTests/media/video-cuepoint-multiple-expected.txt b/LayoutTests/media/video-cuepoint-multiple-expected.txt
new file mode 100644 (file)
index 0000000..4de0219
--- /dev/null
@@ -0,0 +1,6 @@
+TEST(video.currentTime.toFixed(1) == 0.1) OK
+TEST(!video.paused) OK
+TEST(video.currentTime.toFixed(1) == 0.1) OK
+TEST(!video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-cuepoint-multiple.html b/LayoutTests/media/video-cuepoint-multiple.html
new file mode 100644 (file)
index 0000000..96b7fcc
--- /dev/null
@@ -0,0 +1,16 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+function cueHit() {
+    test("video.currentTime.toFixed(1) == 0.1");
+    test("!video.paused");    
+}
+function cueHit2() {
+    test("video.currentTime.toFixed(1) == 0.1");
+    test("!video.paused");    
+    endTest();
+}
+video.addCuePoint(0.1, cueHit);
+video.addCuePoint(0.1, cueHit2);
+video.play();
+</script>
diff --git a/LayoutTests/media/video-cuepoint-pause-expected.txt b/LayoutTests/media/video-cuepoint-pause-expected.txt
new file mode 100644 (file)
index 0000000..e3853bb
--- /dev/null
@@ -0,0 +1,6 @@
+TEST(video.currentTime.toFixed(1) == 0.1) OK
+TEST(!video.paused) OK
+TEST(video.currentTime.toFixed(1) == 0.2) OK
+TEST(video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-cuepoint-pause.html b/LayoutTests/media/video-cuepoint-pause.html
new file mode 100644 (file)
index 0000000..c242bb3
--- /dev/null
@@ -0,0 +1,16 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+function cueHit() {
+    test("video.currentTime.toFixed(1) == 0.1");
+    test("!video.paused");    
+}
+function cueHit2() {
+    test("video.currentTime.toFixed(1) == 0.2");
+    test("video.paused");    
+    endTest();
+}
+video.addCuePoint(0.1, cueHit);
+video.addCuePoint(0.2, cueHit2, true);
+video.play();
+</script>
diff --git a/LayoutTests/media/video-cuepoint-remove-expected.txt b/LayoutTests/media/video-cuepoint-remove-expected.txt
new file mode 100644 (file)
index 0000000..23c3bb0
--- /dev/null
@@ -0,0 +1,4 @@
+TEST(video.currentTime.toFixed(1) == 0.2) OK
+TEST(!video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-cuepoint-remove-multiple-expected.txt b/LayoutTests/media/video-cuepoint-remove-multiple-expected.txt
new file mode 100644 (file)
index 0000000..df8704d
--- /dev/null
@@ -0,0 +1,4 @@
+TEST(video.currentTime.toFixed(1) == 0.1) OK
+TEST(!video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-cuepoint-remove-multiple.html b/LayoutTests/media/video-cuepoint-remove-multiple.html
new file mode 100644 (file)
index 0000000..3bd8cfe
--- /dev/null
@@ -0,0 +1,16 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+function cueHit() {
+    test("false");   
+}
+function cueHit2() {
+    test("video.currentTime.toFixed(1) == 0.1");
+    test("!video.paused");    
+    endTest();
+}
+video.addCuePoint(0.1, cueHit);
+video.addCuePoint(0.1, cueHit2);
+video.removeCuePoint(0.1, cueHit);
+video.play();
+</script>
diff --git a/LayoutTests/media/video-cuepoint-remove.html b/LayoutTests/media/video-cuepoint-remove.html
new file mode 100644 (file)
index 0000000..a2c35f2
--- /dev/null
@@ -0,0 +1,16 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+function cueHit() {
+    test("false");   
+}
+function cueHit2() {
+    test("video.currentTime.toFixed(1) == 0.2");
+    test("!video.paused");    
+    endTest();
+}
+video.addCuePoint(0.1, cueHit);
+video.addCuePoint(0.2, cueHit2);
+video.removeCuePoint(0.1, cueHit);
+video.play();
+</script>
diff --git a/LayoutTests/media/video-currentTime-expected.txt b/LayoutTests/media/video-currentTime-expected.txt
new file mode 100644 (file)
index 0000000..76ef9d6
--- /dev/null
@@ -0,0 +1,6 @@
+TEST(video.currentTime == 0) OK
+EVENT(load) TEST(video.currentTime == 0) OK
+EVENT(play) TEST(video.currentTime == 0) OK
+TEST(video.currentTime > 0) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-currentTime-set-expected.txt b/LayoutTests/media/video-currentTime-set-expected.txt
new file mode 100644 (file)
index 0000000..2c5f214
--- /dev/null
@@ -0,0 +1,5 @@
+EVENT(load)
+EVENT(play)
+EVENT(ended)
+END OF TEST
+
diff --git a/LayoutTests/media/video-currentTime-set.html b/LayoutTests/media/video-currentTime-set.html
new file mode 100644 (file)
index 0000000..eed3d00
--- /dev/null
@@ -0,0 +1,15 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+waitForEvent('load',  
+function () { 
+    video.currentTime = video.duration - 0.2; 
+    video.play(); 
+});
+waitForEvent('play',
+function () {
+    setTimeout(function () { test("false") }, 400);
+});
+waitForEventAndEnd('ended');
+
+</script>
diff --git a/LayoutTests/media/video-currentTime-set2-expected.txt b/LayoutTests/media/video-currentTime-set2-expected.txt
new file mode 100644 (file)
index 0000000..5c542b1
--- /dev/null
@@ -0,0 +1,5 @@
+EVENT(load)
+TEST(video.currentTime.toFixed(1) == 1.5) OK
+TEST(video.currentTime.toFixed(1) == 3.1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-currentTime-set2.html b/LayoutTests/media/video-currentTime-set2.html
new file mode 100644 (file)
index 0000000..585d831
--- /dev/null
@@ -0,0 +1,14 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+waitForEvent('load',  
+function () { 
+    video.currentTime = 1.5; 
+    test("video.currentTime.toFixed(1) == 1.5");
+    video.play();
+    video.currentTime = 3.1; 
+    test("video.currentTime.toFixed(1) == 3.1");
+    endTest();
+});
+
+</script>
diff --git a/LayoutTests/media/video-currentTime.html b/LayoutTests/media/video-currentTime.html
new file mode 100644 (file)
index 0000000..7f562b1
--- /dev/null
@@ -0,0 +1,13 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.currentTime == 0")
+waitForEventAndTest('load', "video.currentTime == 0");
+video.addEventListener('load', function() { video.play(); setTimeout(testCurrentTime, 500) });
+waitForEventAndTest('play', "video.currentTime == 0");
+function testCurrentTime()
+{
+    test("video.currentTime > 0")
+    endTest();
+}
+</script>
diff --git a/LayoutTests/media/video-dom-autoplay-expected.txt b/LayoutTests/media/video-dom-autoplay-expected.txt
new file mode 100644 (file)
index 0000000..e07854a
--- /dev/null
@@ -0,0 +1,6 @@
+TEST(!video.autoplay) OK
+TEST(video.autoplay) OK
+TEST(video.getAttribute('autoplay') != null) OK
+EVENT(play) TEST(!video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-autoplay.html b/LayoutTests/media/video-dom-autoplay.html
new file mode 100644 (file)
index 0000000..a3762f0
--- /dev/null
@@ -0,0 +1,9 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("!video.autoplay");
+video.autoplay = true;
+test("video.autoplay");
+test("video.getAttribute('autoplay') != null");
+waitForEventTestAndEnd('play', "!video.paused");
+</script>
diff --git a/LayoutTests/media/video-dom-end-expected.txt b/LayoutTests/media/video-dom-end-expected.txt
new file mode 100644 (file)
index 0000000..110a410
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.end == 0.5) OK
+TEST(video.getAttribute('end') == '0.5s') OK
+EVENT(ended) TEST(video.currentTime == 0.5) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-end.html b/LayoutTests/media/video-dom-end.html
new file mode 100644 (file)
index 0000000..d78d7a7
--- /dev/null
@@ -0,0 +1,8 @@
+<video autoplay src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+video.end = 0.5;
+test("video.end == 0.5");
+test("video.getAttribute('end') == '0.5s'");
+waitForEventTestAndEnd('ended', "video.currentTime == 0.5");
+</script>
diff --git a/LayoutTests/media/video-dom-loopcount-expected.txt b/LayoutTests/media/video-dom-loopcount-expected.txt
new file mode 100644 (file)
index 0000000..0473d1a
--- /dev/null
@@ -0,0 +1,6 @@
+TEST(video.loopCount == 2) OK
+TEST(video.currentLoop == 0) OK
+TEST(video.getAttribute('loopCount') == 2) OK
+EVENT(ended) TEST(video.currentLoop == 1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-loopcount.html b/LayoutTests/media/video-dom-loopcount.html
new file mode 100644 (file)
index 0000000..41f9d14
--- /dev/null
@@ -0,0 +1,9 @@
+<video src=content/test.mp4 loopend=0.2s end=0.2s autoplay></video>
+<script src=video-test.js></script>
+<script>
+video.loopCount = 2;
+test("video.loopCount == 2");
+test("video.currentLoop == 0");
+test("video.getAttribute('loopCount') == 2");
+waitForEventTestAndEnd('ended', "video.currentLoop == 1");
+</script>
diff --git a/LayoutTests/media/video-dom-loopend-expected.txt b/LayoutTests/media/video-dom-loopend-expected.txt
new file mode 100644 (file)
index 0000000..4a100ec
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.loopEnd==0.5) OK
+TEST(video.getAttribute('loopend') == '0.5s') OK
+EVENT(timeupdate) TEST(video.currentTime.toFixed(1) == 0 && video.currentLoop==1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-loopend.html b/LayoutTests/media/video-dom-loopend.html
new file mode 100644 (file)
index 0000000..893c326
--- /dev/null
@@ -0,0 +1,9 @@
+<video src=content/test.mp4 loopcount=2 autoplay></video>
+<script src=video-test.js></script>
+<script>
+video.loopEnd=0.5;
+test("video.loopEnd==0.5");
+test("video.getAttribute('loopend') == '0.5s'");
+setTimeout(function () { test("video.currentTime<=0.5"); }, 2000);
+waitForEventTestAndEnd('timeupdate', "video.currentTime.toFixed(1) == 0 && video.currentLoop==1");
+</script>
diff --git a/LayoutTests/media/video-dom-loopstart-expected.txt b/LayoutTests/media/video-dom-loopstart-expected.txt
new file mode 100644 (file)
index 0000000..ff54475
--- /dev/null
@@ -0,0 +1,6 @@
+TEST(video.loopStart==1.0) OK
+TEST(video.getAttribute('loopstart') == '1s') OK
+EVENT(play)
+EVENT(timeupdate) TEST(video.currentTime.toFixed(1) && video.currentLoop==1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-loopstart.html b/LayoutTests/media/video-dom-loopstart.html
new file mode 100644 (file)
index 0000000..2d21195
--- /dev/null
@@ -0,0 +1,9 @@
+<video src=content/test.mp4 loopcount=2 autoplay></video>
+<script src=video-test.js></script>
+<script>
+video.loopStart = 1.0;
+test("video.loopStart==1.0");
+test("video.getAttribute('loopstart') == '1s'");
+waitForEvent('play', function () { video.currentTime = 500; });
+waitForEventTestAndEnd('timeupdate', "video.currentTime.toFixed(1) && video.currentLoop==1");
+</script>
diff --git a/LayoutTests/media/video-dom-src-expected.txt b/LayoutTests/media/video-dom-src-expected.txt
new file mode 100644 (file)
index 0000000..39ab3fa
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.currentSrc=='') OK
+TEST(video.currentSrc=='') OK
+EVENT(load) TEST(relativeURL(video.currentSrc)=='content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-src.html b/LayoutTests/media/video-dom-src.html
new file mode 100644 (file)
index 0000000..e5d2d4f
--- /dev/null
@@ -0,0 +1,10 @@
+<video></video>
+<script src=video-test.js></script>
+<script>
+test("video.currentSrc==''");
+video.src = "content/test.mp4";
+test("video.currentSrc==''");
+waitForEventTestAndEnd("load", "relativeURL(video.currentSrc)=='content/test.mp4'");
+
+video.load();
+</script>
diff --git a/LayoutTests/media/video-dom-start-expected.txt b/LayoutTests/media/video-dom-start-expected.txt
new file mode 100644 (file)
index 0000000..d850920
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.start == 1.0) OK
+TEST(video.getAttribute('start') == '1s') OK
+EVENT(canplaythrough) TEST(video.currentTime == 1.0) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-dom-start.html b/LayoutTests/media/video-dom-start.html
new file mode 100644 (file)
index 0000000..e39129c
--- /dev/null
@@ -0,0 +1,8 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+video.start = 1.0;
+test("video.start == 1.0");
+test("video.getAttribute('start') == '1s'");
+waitForEventTestAndEnd('canplaythrough', "video.currentTime == 1.0");
+</script>
diff --git a/LayoutTests/media/video-end-expected.txt b/LayoutTests/media/video-end-expected.txt
new file mode 100644 (file)
index 0000000..6eb4ca2
--- /dev/null
@@ -0,0 +1,7 @@
+TEST(!video.ended) OK
+TEST(video.end == 0.5) OK
+EVENT(ended)
+TEST(video.currentTime == 0.5) OK
+TEST(video.ended) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-end.html b/LayoutTests/media/video-end.html
new file mode 100644 (file)
index 0000000..d9874f9
--- /dev/null
@@ -0,0 +1,14 @@
+<video autoplay src=content/test.mp4 end=0.5s></video>
+<script src=video-test.js></script>
+<script>
+test("!video.ended");
+test("video.end == 0.5");
+waitForEvent('ended', 
+    function () 
+    {
+        test("video.currentTime == 0.5");
+        test("video.ended");
+        endTest();
+    }
+);
+</script>
diff --git a/LayoutTests/media/video-error-abort-expected.txt b/LayoutTests/media/video-error-abort-expected.txt
new file mode 100644 (file)
index 0000000..02aaa8c
--- /dev/null
@@ -0,0 +1,7 @@
+TEST(!video.error) OK
+EVENT(begin)
+EVENT(abort) TEST(video.error.code == MediaError.MEDIA_ERR_ABORTED) OK
+EVENT(begin)
+EVENT(load) TEST(!video.error) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-error-abort.html b/LayoutTests/media/video-error-abort.html
new file mode 100644 (file)
index 0000000..85c07af
--- /dev/null
@@ -0,0 +1,9 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("!video.error");
+var didLoad = false;
+waitForEvent("begin", function () { if (didLoad) return; didLoad = true; video.load(); });
+waitForEventAndTest("abort", "video.error.code == MediaError.MEDIA_ERR_ABORTED");
+waitForEventTestAndEnd("load", "!video.error");
+</script>
diff --git a/LayoutTests/media/video-error-does-not-exist-expected.txt b/LayoutTests/media/video-error-does-not-exist-expected.txt
new file mode 100644 (file)
index 0000000..7e8e825
--- /dev/null
@@ -0,0 +1,4 @@
+TEST(!video.error) OK
+EVENT(emptied) TEST(video.error.code == MediaError.MEDIA_ERR_NETWORK) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-error-does-not-exist.html b/LayoutTests/media/video-error-does-not-exist.html
new file mode 100644 (file)
index 0000000..6de7595
--- /dev/null
@@ -0,0 +1,7 @@
+<video src=content/does-not-exist.mpeg></video>
+<script src=video-test.js></script>
+<script>
+test("!video.error");
+waitForEventAndTest("load", "false");
+waitForEventTestAndEnd("emptied", "video.error.code == MediaError.MEDIA_ERR_NETWORK");
+</script>
diff --git a/LayoutTests/media/video-load-networkState-expected.txt b/LayoutTests/media/video-load-networkState-expected.txt
new file mode 100644 (file)
index 0000000..ef3d8fb
--- /dev/null
@@ -0,0 +1,7 @@
+TEST(video.networkState == HTMLMediaElement.EMPTY) OK
+EVENT(begin) TEST(video.networkState == HTMLMediaElement.LOADING) OK
+EVENT(loadedmetadata) TEST(video.networkState == HTMLMediaElement.LOADED_METADATA) OK
+EVENT(loadedfirstframe) TEST(video.networkState == HTMLMediaElement.LOADED_FIRST_FRAME) OK
+EVENT(load) TEST(video.networkState == HTMLMediaElement.LOADED) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-load-networkState.html b/LayoutTests/media/video-load-networkState.html
new file mode 100644 (file)
index 0000000..3a1c667
--- /dev/null
@@ -0,0 +1,9 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.networkState == HTMLMediaElement.EMPTY");
+waitForEventAndTest("begin", "video.networkState == HTMLMediaElement.LOADING");
+waitForEventAndTest("loadedmetadata", "video.networkState == HTMLMediaElement.LOADED_METADATA");
+waitForEventAndTest("loadedfirstframe", "video.networkState == HTMLMediaElement.LOADED_FIRST_FRAME");
+waitForEventTestAndEnd("load", "video.networkState == HTMLMediaElement.LOADED");
+</script>
diff --git a/LayoutTests/media/video-load-readyState-expected.txt b/LayoutTests/media/video-load-readyState-expected.txt
new file mode 100644 (file)
index 0000000..af61e60
--- /dev/null
@@ -0,0 +1,8 @@
+TEST(video.readyState == HTMLMediaElement.DATA_UNAVAILABLE) OK
+EVENT(begin) TEST(video.readyState == HTMLMediaElement.DATA_UNAVAILABLE) OK
+EVENT(loadedmetadata) TEST(video.readyState == HTMLMediaElement.DATA_UNAVAILABLE) OK
+EVENT(loadedfirstframe) TEST(video.readyState == HTMLMediaElement.CAN_SHOW_CURRENT_FRAME) OK
+EVENT(canshowcurrentframe) TEST(video.readyState == HTMLMediaElement.CAN_SHOW_CURRENT_FRAME) OK
+EVENT(canplaythrough) TEST(video.readyState == HTMLMediaElement.CAN_PLAY_THROUGH) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-load-readyState.html b/LayoutTests/media/video-load-readyState.html
new file mode 100644 (file)
index 0000000..05e8dd9
--- /dev/null
@@ -0,0 +1,10 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.readyState == HTMLMediaElement.DATA_UNAVAILABLE");
+waitForEventAndTest("begin", "video.readyState == HTMLMediaElement.DATA_UNAVAILABLE");
+waitForEventAndTest("loadedmetadata", "video.readyState == HTMLMediaElement.DATA_UNAVAILABLE");
+waitForEventAndTest("loadedfirstframe", "video.readyState == HTMLMediaElement.CAN_SHOW_CURRENT_FRAME");
+waitForEventAndTest("canshowcurrentframe", "video.readyState == HTMLMediaElement.CAN_SHOW_CURRENT_FRAME");
+waitForEventTestAndEnd("canplaythrough", "video.readyState == HTMLMediaElement.CAN_PLAY_THROUGH");
+</script>
diff --git a/LayoutTests/media/video-loopcount-expected.txt b/LayoutTests/media/video-loopcount-expected.txt
new file mode 100644 (file)
index 0000000..83c346a
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.loopCount == 2) OK
+TEST(video.currentLoop == 0) OK
+EVENT(ended) TEST(video.currentLoop == 1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-loopcount.html b/LayoutTests/media/video-loopcount.html
new file mode 100644 (file)
index 0000000..48820c1
--- /dev/null
@@ -0,0 +1,7 @@
+<video src=content/test.mp4 loopcount=2 loopend=0.2s end=0.2s autoplay></video>
+<script src=video-test.js></script>
+<script>
+test("video.loopCount == 2");
+test("video.currentLoop == 0");
+waitForEventTestAndEnd('ended', "video.currentLoop == 1");
+</script>
diff --git a/LayoutTests/media/video-loopend-expected.txt b/LayoutTests/media/video-loopend-expected.txt
new file mode 100644 (file)
index 0000000..008d202
--- /dev/null
@@ -0,0 +1,4 @@
+TEST(video.loopEnd==0.5) OK
+EVENT(timeupdate) TEST(video.currentTime.toFixed(1) == 0 && video.currentLoop==1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-loopend.html b/LayoutTests/media/video-loopend.html
new file mode 100644 (file)
index 0000000..ef99976
--- /dev/null
@@ -0,0 +1,8 @@
+<video src=content/test.mp4 loopcount=2 autoplay></video>
+<script src=video-test.js></script>
+<script>
+video.loopEnd = 0.5;
+test("video.loopEnd==0.5");
+setTimeout(function () { test("video.currentTime<=0.5"); }, 2000);
+waitForEventTestAndEnd('timeupdate', "video.currentTime.toFixed(1) == 0 && video.currentLoop==1");
+</script>
diff --git a/LayoutTests/media/video-loopstart-expected.txt b/LayoutTests/media/video-loopstart-expected.txt
new file mode 100644 (file)
index 0000000..35cc641
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.loopStart==1.0) OK
+EVENT(play)
+EVENT(timeupdate) TEST(video.currentTime.toFixed(1) == 1.0 && video.currentLoop==1) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-loopstart.html b/LayoutTests/media/video-loopstart.html
new file mode 100644 (file)
index 0000000..2aff30b
--- /dev/null
@@ -0,0 +1,7 @@
+<video src=content/test.mp4 loopcount=2 loopstart=1s autoplay></video>
+<script src=video-test.js></script>
+<script>
+test("video.loopStart==1.0");
+waitForEvent('play', function () { video.currentTime = 500; });
+waitForEventTestAndEnd('timeupdate', "video.currentTime.toFixed(1) == 1.0 && video.currentLoop==1");
+</script>
diff --git a/LayoutTests/media/video-muted-expected.txt b/LayoutTests/media/video-muted-expected.txt
new file mode 100644 (file)
index 0000000..90bf707
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(!video.muted) OK
+TEST(video.muted) OK
+TEST(!video.muted) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-muted.html b/LayoutTests/media/video-muted.html
new file mode 100644 (file)
index 0000000..92d54b4
--- /dev/null
@@ -0,0 +1,10 @@
+<video></video>
+<script src=video-test.js></script>
+<script>
+test("!video.muted");
+video.muted = true;
+test("video.muted");
+video.muted = false;
+test("!video.muted");
+endTest();
+</script>
diff --git a/LayoutTests/media/video-no-autoplay-expected.txt b/LayoutTests/media/video-no-autoplay-expected.txt
new file mode 100644 (file)
index 0000000..91ff648
--- /dev/null
@@ -0,0 +1,5 @@
+TEST(video.paused) OK
+EVENT(load)
+TEST(video.paused) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-no-autoplay.html b/LayoutTests/media/video-no-autoplay.html
new file mode 100644 (file)
index 0000000..31a180e
--- /dev/null
@@ -0,0 +1,7 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.paused");
+waitForEventAndTest("play", "false");
+waitForEvent("load", function () { setTimeout(testAndEnd('video.paused', 500)) });
+</script>
diff --git a/LayoutTests/media/video-seekable-expected.txt b/LayoutTests/media/video-seekable-expected.txt
new file mode 100644 (file)
index 0000000..d47ada8
--- /dev/null
@@ -0,0 +1,15 @@
+TEST(video.seekable.length == 0) OK
+TEST(video.seekable.start(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.seekable.end(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.seekable.start(0)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.seekable.end(0)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+EVENT(load)
+TEST(video.seekable.length == 1) OK
+TEST(video.seekable.start(0) == 0) OK
+TEST(video.seekable.end(0) > 0) OK
+TEST(video.seekable.start(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.seekable.end(-1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.seekable.start(1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.seekable.end(1)) THROWS(DOMException.INDEX_SIZE_ERR) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-seekable.html b/LayoutTests/media/video-seekable.html
new file mode 100644 (file)
index 0000000..caef55c
--- /dev/null
@@ -0,0 +1,22 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.seekable.length == 0");
+testException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR");
+testException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR");
+testException("video.seekable.start(0)", "DOMException.INDEX_SIZE_ERR");
+testException("video.seekable.end(0)", "DOMException.INDEX_SIZE_ERR");
+waitForEvent('load',
+    function () 
+    {
+        test("video.seekable.length == 1");
+        test("video.seekable.start(0) == 0");
+        test("video.seekable.end(0) > 0");
+        testException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR");
+        testException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR");
+        testException("video.seekable.start(1)", "DOMException.INDEX_SIZE_ERR");
+        testException("video.seekable.end(1)", "DOMException.INDEX_SIZE_ERR");
+        endTest();
+    }
+);
+</script>
diff --git a/LayoutTests/media/video-size-expected.txt b/LayoutTests/media/video-size-expected.txt
new file mode 100644 (file)
index 0000000..25657ce
--- /dev/null
@@ -0,0 +1,4 @@
+TEST(video.videoWidth == 0 && video.videoHeight == 0) OK
+EVENT(loadedmetadata) TEST(video.videoWidth > 0 && video.videoHeight > 0) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-size.html b/LayoutTests/media/video-size.html
new file mode 100644 (file)
index 0000000..0c4a0e7
--- /dev/null
@@ -0,0 +1,6 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+test("video.videoWidth == 0 && video.videoHeight == 0");
+waitForEventTestAndEnd('loadedmetadata', "video.videoWidth > 0 && video.videoHeight > 0");
+</script>
diff --git a/LayoutTests/media/video-source-expected.txt b/LayoutTests/media/video-source-expected.txt
new file mode 100644 (file)
index 0000000..dca11b9
--- /dev/null
@@ -0,0 +1,3 @@
+EVENT(begin) TEST(relativeURL(video.currentSrc) == 'content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-source-media-expected.txt b/LayoutTests/media/video-source-media-expected.txt
new file mode 100644 (file)
index 0000000..dca11b9
--- /dev/null
@@ -0,0 +1,3 @@
+EVENT(begin) TEST(relativeURL(video.currentSrc) == 'content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-source-media.html b/LayoutTests/media/video-source-media.html
new file mode 100644 (file)
index 0000000..ffa505e
--- /dev/null
@@ -0,0 +1,9 @@
+<video>
+    <source src=content/error.mpeg media="print">
+    <source src=content/error2.mpeg media="screen and (min-device-width: 80000px)">
+    <source src=content/test.mp4 media="screen and (min-device-width: 100px)">
+</video>
+<script src=video-test.js></script>
+<script>
+waitForEventTestAndEnd('begin', "relativeURL(video.currentSrc) == 'content/test.mp4'");
+</script>
diff --git a/LayoutTests/media/video-source-type-expected.txt b/LayoutTests/media/video-source-type-expected.txt
new file mode 100644 (file)
index 0000000..dca11b9
--- /dev/null
@@ -0,0 +1,3 @@
+EVENT(begin) TEST(relativeURL(video.currentSrc) == 'content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-source-type.html b/LayoutTests/media/video-source-type.html
new file mode 100644 (file)
index 0000000..37dd64d
--- /dev/null
@@ -0,0 +1,9 @@
+<video>
+    <source src=content/error.mpeg type=video/blahblah>
+    <source src=content/test.mp4 type=video/mpeg>
+    <source src=content/error2.mpeg type=video/mpeg>
+</video>
+<script src=video-test.js></script>
+<script>
+waitForEventTestAndEnd('begin', "relativeURL(video.currentSrc) == 'content/test.mp4'");
+</script>
diff --git a/LayoutTests/media/video-source.html b/LayoutTests/media/video-source.html
new file mode 100644 (file)
index 0000000..dcbce53
--- /dev/null
@@ -0,0 +1,7 @@
+<video>
+    <source src=content/test.mp4>
+</video>
+<script src=video-test.js></script>
+<script>
+waitForEventTestAndEnd('begin', "relativeURL(video.currentSrc) == 'content/test.mp4'");
+</script>
diff --git a/LayoutTests/media/video-src-expected.txt b/LayoutTests/media/video-src-expected.txt
new file mode 100644 (file)
index 0000000..dca11b9
--- /dev/null
@@ -0,0 +1,3 @@
+EVENT(begin) TEST(relativeURL(video.currentSrc) == 'content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-src-source-expected.txt b/LayoutTests/media/video-src-source-expected.txt
new file mode 100644 (file)
index 0000000..dca11b9
--- /dev/null
@@ -0,0 +1,3 @@
+EVENT(begin) TEST(relativeURL(video.currentSrc) == 'content/test.mp4') OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-src-source.html b/LayoutTests/media/video-src-source.html
new file mode 100644 (file)
index 0000000..d1eab7d
--- /dev/null
@@ -0,0 +1,7 @@
+<video src=content/test.mp4>
+    <source src=content/error.mpeg>
+</video>
+<script src=video-test.js></script>
+<script>
+waitForEventTestAndEnd('begin', "relativeURL(video.currentSrc) == 'content/test.mp4'");
+</script>
diff --git a/LayoutTests/media/video-src.html b/LayoutTests/media/video-src.html
new file mode 100644 (file)
index 0000000..66ee4ff
--- /dev/null
@@ -0,0 +1,5 @@
+<video src=content/test.mp4></video>
+<script src=video-test.js></script>
+<script>
+waitForEventTestAndEnd('begin', "relativeURL(video.currentSrc) == 'content/test.mp4'");
+</script>
diff --git a/LayoutTests/media/video-start-expected.txt b/LayoutTests/media/video-start-expected.txt
new file mode 100644 (file)
index 0000000..460d019
--- /dev/null
@@ -0,0 +1,4 @@
+TEST(video.start == 1.0) OK
+EVENT(canplaythrough) TEST(video.currentTime == 1.0) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-start.html b/LayoutTests/media/video-start.html
new file mode 100644 (file)
index 0000000..b0db447
--- /dev/null
@@ -0,0 +1,6 @@
+<video src=content/test.mp4 start=1s></video>
+<script src=video-test.js></script>
+<script>
+test("video.start == 1.0");
+waitForEventTestAndEnd('canplaythrough', "video.currentTime == 1.0");
+</script>
diff --git a/LayoutTests/media/video-test.js b/LayoutTests/media/video-test.js
new file mode 100644 (file)
index 0000000..a592823
--- /dev/null
@@ -0,0 +1,111 @@
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+var video = document.getElementsByTagName('video')[0];
+var media;
+if (video)
+    media = video;
+var console = document.createElement('div');
+document.body.appendChild(console);
+
+function hanged()
+{
+    consoleWrite("FAIL: timed out");
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();  
+}
+setTimeout(hanged, 10000);
+
+function testAndEnd(testFuncString)
+{
+    test(testFuncString, true);
+}
+
+function test(testFuncString, endit)
+{
+    if (eval(testFuncString))
+        consoleWrite("TEST(" + testFuncString + ") <span style='color:green'>OK</span>");
+    else
+        consoleWrite("TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>");    
+
+    if (endit)
+        endTest();  
+}
+
+function waitForEventAndEnd(eventName, funcString)
+{
+    waitForEvent(eventName, funcString, true)
+}
+
+function waitForEvent(eventName, func, endit)
+{
+    function _eventCallback(event)
+    {
+        consoleWrite("EVENT(" + eventName + ")");
+        
+        if (func)
+            func();
+        
+        if (endit)
+            endTest();    
+    }
+
+    media.addEventListener(eventName, _eventCallback);    
+}
+
+function waitForEventTestAndEnd(eventName, testFuncString)
+{
+    waitForEventAndTest(eventName, testFuncString, true);
+}
+
+function waitForEventAndTest(eventName, testFuncString, endit)
+{
+    function _eventCallback(event)
+    {
+        if (eval(testFuncString))
+            consoleWrite("EVENT(" + eventName + ") TEST(" + testFuncString + ") <span style='color:green'>OK</span>");
+        else
+            consoleWrite("EVENT(" + eventName + ") TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>");
+        
+        if (endit)
+            endTest();    
+    }
+    
+    media.addEventListener(eventName, _eventCallback);
+}
+
+function testException(testString, exceptionString)
+{
+    try {
+        eval(testString);
+    } catch (ex) { 
+        if (ex.code == eval(exceptionString))
+            consoleWrite("TEST(" + testString + ") THROWS("+exceptionString+") <span style='color:green'>OK</span>");
+        else
+            consoleWrite("TEST(" + testString + ") THROWS("+exceptionString+") <span style='color:red'>FAIL</span>");    
+    }
+}
+
+var testEnded = false;
+
+function endTest()
+{
+    consoleWrite("END OF TEST");
+    testEnded = true;
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();     
+}
+
+function consoleWrite(text)
+{
+    if (testEnded)
+        return;
+    console.innerHTML += text + "<br>";
+}
+
+function relativeURL(url)
+{
+    return url.substr(url.indexOf('/media/')+7);
+}
\ No newline at end of file
diff --git a/LayoutTests/media/video-volume-expected.txt b/LayoutTests/media/video-volume-expected.txt
new file mode 100644 (file)
index 0000000..8392161
--- /dev/null
@@ -0,0 +1,7 @@
+TEST(video.volume == 0.5) OK
+TEST(video.volume == 1) OK
+TEST(video.volume == 0) OK
+TEST(video.volume = 1.5) THROWS(DOMException.INDEX_SIZE_ERR) OK
+TEST(video.volume = -0.5) THROWS(DOMException.INDEX_SIZE_ERR) OK
+END OF TEST
+
diff --git a/LayoutTests/media/video-volume.html b/LayoutTests/media/video-volume.html
new file mode 100644 (file)
index 0000000..b0faa25
--- /dev/null
@@ -0,0 +1,12 @@
+<video></video>
+<script src=video-test.js></script>
+<script>
+test("video.volume == 0.5");
+video.volume = 1;
+test("video.volume == 1");
+video.volume = 0;
+test("video.volume == 0");
+testException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
+testException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
+endTest();
+</script>
index aefaa28..4796985 100644 (file)
@@ -1011,3 +1011,6 @@ webarchive/test-script-src.html
 webarchive/test-table-background.html
 webarchive/test-td-background.html
 webarchive/loading/test-loading-archive.html
+
+# ------- <video> support
+media
index 3b419ca..cd4cbf6 100644 (file)
@@ -613,3 +613,6 @@ http/tests/xmlhttprequest/failed-auth.html
 http/tests/xmlhttprequest/small-chunks-response-text.html
 plugins/netscape-plugin-setwindow-size.html
 svg/custom/gradient-stop-style-change.svg
+
+# <video> support
+media