Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-size.html
blobc237ff0a0c884a2362ba8ba9ad7583aa7af4336d
1 <html>
2 <head>
3 <title>&lt;video&gt; element size and resize test</title>
4 <script src=video-test.js></script>
5 <script src=media-file.js></script>
7 <script>
8 var movieInfo =
10 current:0,
11 movies:
14 src:null,
15 poster:null,
16 description:"no 'src' and no 'poster', with 'width' and 'height' attributes",
17 width:640,
18 height:480,
19 videoWidth:0,
20 videoHeight:0
23 src:null,
24 poster:null,
25 description:"no 'src' and no 'poster', with NO 'width' and 'height' attributes, should be default size",
26 width:300,
27 height:150,
28 videoWidth:0,
29 videoHeight:0
32 src:null,
33 poster:"content/abe.png",
34 description:"'poster' but no 'src', should be image size",
35 width:76,
36 height:103,
37 videoWidth:0,
38 videoHeight:0
41 src:"content/test",
42 poster:"content/abe.png",
43 description:"'poster' and 'src', should be &lt;video&gt; size",
44 width:320,
45 height:240,
46 videoWidth:320,
47 videoHeight:240
50 src:"content/bogus",
51 poster:"content/greenbox.png",
52 description:"'poster' and invalid 'src', should be image size",
53 width:25,
54 height:25,
55 videoWidth:0,
56 videoHeight:0
61 function setupNextConfiguration()
63 consoleWrite("");
64 if (movieInfo.current >= movieInfo.movies.length)
66 endTest();
67 return;
70 var movie = movieInfo.movies[movieInfo.current];
71 if (movie.src || movie.poster) {
72 var desc = "<b>Setting ";
73 if (movie.src && relativeURL(video.src) != movie.src) {
74 video.src = findMediaFile("video", movie.src);
75 desc += "'src' to <em>\""+ movie.src + ".[extension]\"</em> ";
77 if (movie.poster && relativeURL(video.poster) != movie.poster) {
78 video.poster = movie.poster;
79 desc += "'poster' to <em>\""+ movie.poster + "\"</em>";
81 consoleWrite(desc + "</b>");
84 // Remove width/height attributes if present
85 if (video.width || video.height) {
86 consoleWrite("<b>Removing 'width' and 'height' attributes.</b>");
87 video.removeAttribute('width');
88 video.removeAttribute('height');
91 if (!movie.src || movie.src.indexOf('bogus') >= 0)
92 setTimeout(testMovie, 100);
95 function testMovie()
97 if (movieInfo.current >= movieInfo.movies.length)
98 return;
100 var temp = document.body.offsetWidth;
101 var movie = movieInfo.movies[movieInfo.current];
103 var desc = "<b>Testing movie with " + movie.description + ".</b>";
104 consoleWrite(desc);
106 testExpected("video.clientWidth", movie.width);
107 testExpected("video.clientHeight", movie.height);
108 testExpected("video.videoWidth", movie.videoWidth);
109 testExpected("video.videoHeight", movie.videoHeight);
111 movieInfo.current++;
112 setupNextConfiguration();
115 function test()
117 findMediaElement();
118 testMovie();
120 </script>
121 </head>
123 <body onload="setTimeout(test, 100)">
125 <video controls width=640 height=480 onloadedmetadata="testMovie()"></video>
126 <p>Test &lt;video&gt; element size with and without 'src' and 'poster' attributes.</p>
128 </body>
129 </html>