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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-is-type-supported.html

Issue 16625011: Add minimal implementation of unprefixed MediaSource API that has feature parity with prefixed API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix global-constructors-listing-expected.txt Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/w3c/resources/testharness.js"></script>
5 <script src="/w3c/resources/testharnessreport.js"></script>
6 <link rel='stylesheet' href='/w3c/resources/testharness.css'>
7 </head>
8 <body>
9 <div id="log"></div>
10 <script>
11 test(function ()
12 {
13 var invalidTypes = [
14 // Invalid MIME format.
15 'video',
16 'video/',
17 'video/webm',
18 'video/webm;',
19 'video/webm;codecs',
20 'video/webm;codecs=',
21 'video/webm;codecs="',
22 'video/webm;codecs=""',
23 'video/webm;codecs=","',
24
25 // Mismatch between major type and codec ID
26 'audio/webm;codecs="vp8"',
27 'audio/mp4;codecs="avc1.4d001e"',
28
29 // Mismatch between minor type and codec ID.
30 'audio/mp4;codecs="vorbis"',
31 'audio/webm;codecs="mp4a.40.2"',
32 'video/mp4;codecs="vp8"',
33 'video/webm;codecs="mp4a.40.2"',
34
35 // Invalid codec IDs.
36 'audio/webm;codecs="mp4a"',
37 'audio/webm;codecs="mp4a.40"',
38 'audio/webm;codecs="mp4a.40."',
39 'audio/mp4;codecs="mp4a.67.3"'
40 ];
41
42 for (var i = 0; i < invalidTypes.length; ++i) {
43 assert_false(MediaSource.isTypeSupported(invalidTypes[i]), "Type \"" + invalidTypes[i] + "\" not supported");
44 }
45 }, "Test invalid types");
46
47 test(function ()
48 {
49 var validTypes = [
50 'video/webm;codecs="vp8"',
51 'video/webm;codecs="vorbis"',
52 'video/webm;codecs="vp8,vorbis"',
53 'video/webm;codecs="vorbis, vp8"',
54 'audio/webm;codecs="vorbis"',
55 ];
56
57 for (var i = 0; i < validTypes.length; ++i) {
58 assert_true(MediaSource.isTypeSupported(validTypes[i]), "Type \" " + validTypes[i] + "\" supported");
59 }
60 }, "Test valid WebM types");
61
62 test(function ()
63 {
64 var validTypes = [
65 'video/mp4;codecs="avc1.4d001e"', // H.264 Main Profile leve l 3.0
66 'video/mp4;codecs="avc1.42001e"', // H.264 Baseline Profile level 3.0
67 'audio/mp4;codecs="mp4a.40.2"', // MPEG4 AAC-LC
68 'audio/mp4;codecs="mp4a.40.5"', // MPEG4 HE-AAC
69 'audio/mp4;codecs="mp4a.67"', // MPEG2 AAC-LC
70 'video/mp4;codecs="mp4a.40.2"',
71 'video/mp4;codecs="avc1.4d001e,mp4a.40.2"',
72 'video/mp4;codecs="mp4a.40.2 , avc1.4d001e "',
73 'video/mp4;codecs="avc1.4d001e,mp4a.40.5"',
74 'video/mp4;codecs="avc1.4d001e,mp4a.40.5"',
75 ];
76
77 for (var i = 0; i < validTypes.length; ++i) {
78 assert_true(MediaSource.isTypeSupported(validTypes[i]), "Type \" " + validTypes[i] + "\" supported");
79 }
80 }, "Test valid MP4 types");
81 </script>
82 </body>
83 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698