[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-orientation.html
1 <html lang="en">
2     <head>
3         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4         <title>&lt;video&gt; rotation test</title>
5         <script src=video-test.js></script>
6
7         <script>
8
9             var movieInfo =
10             {
11                 current:0,
12                 movies:
13                 [
14                     {
15                         url:"content/no-rotation.mp4",
16                         description:"video with no rotation tag set, size 352x288",
17                         width:352,
18                         height:288
19                     },
20                     {
21                         url:"content/rotation-90.mp4",
22                         description:"video with rotation-90 tag set, size 352x288",
23                         width:288,
24                         height:352
25                     },
26                     {
27                         url:"content/rotation-180.mp4",
28                         description:"video with rotation-180 tag set, size 352x288",
29                         width:352,
30                         height:288
31                     },
32                     {
33                         url:"content/rotation-270.mp4",
34                         description:"video with rotation-270 tag set, size 352x288",
35                         width:288,
36                         height:352
37                     },
38                 ]
39             };
40
41             function testSize()
42             {
43                 var movie = movieInfo.movies[movieInfo.current];
44
45                 testExpected("video.videoWidth", movie.width);
46                 testExpected("video.videoHeight", movie.height);
47
48                 movieInfo.current++;
49                 openNextMovie();
50             }
51
52             function openNextMovie()
53             {
54                 consoleWrite("");
55                 if (movieInfo.current >= movieInfo.movies.length)
56                 {
57                     endTest();
58                     return;
59                 }
60
61                 var url = movieInfo.movies[movieInfo.current].url;
62                 video.src = url;
63                 var desc = "<b>Loading</b> <em>\""+ url + "\"</em>" +
64                             ". Movie " + movieInfo.movies[movieInfo.current].description + ".</em>";
65                 consoleWrite(desc);
66                 if (movieInfo.current > 0)
67                     video.load();
68             }
69
70             function start()
71             {
72                 findMediaElement();
73
74                 waitForEvent("error");
75                 waitForEvent("loadstart");
76                 waitForEvent("waiting");
77                 waitForEvent("ratechange");
78                 waitForEvent("durationchange");
79                 waitForEvent("pause");
80                 waitForEvent("play");
81                 waitForEvent("playing");
82
83                 waitForEvent('loadedmetadata', testSize);
84
85                 consoleWrite("<b>Test size before movie is open:</b>");
86                 testExpected("video.videoWidth", 0, "==");
87                 testExpected("video.videoHeight", 0, "==");
88
89                 openNextMovie();
90             }
91         </script>
92     </head>
93
94     <body onload="start()">
95
96         <video></video>
97
98     </body>
99 </html>