8 font-family: Sans-serif;
20 padding:
0 0 14px
8px;
21 border-right:
4px solid LightGray;
33 background-color: #eee;
34 border-right:
4px solid Gray;
42 padding:
8px
8px
8px
8px;
44 border-right:
4px solid LightGray;
46 -webkit-transition-property: border-right, background-color;
47 -webkit-transition-duration:
0.4s;
52 -webkit-box-orient: vertical;
53 -webkit-box-flex:
0.5;
57 -webkit-box-flex:
0.5;
70 <!-- LayoutTests location is hard-coded to avoid duplication of code. -->
71 <script src=
"http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/media-file.js"></script>
74 var MEDIA_FILES_LOCATION
= 'http://svn.webkit.org/repository/webkit/trunk/LayoutTests/media/content';
81 title
: 'Typical video with controls',
82 description
: '<p>Should have "Rewind", "Play", "Mute" buttons, timeline with time current and remaining shown.</p>' +
83 '<p>You may see brief resize of the video when the metadata arrives and a brief flash of the "Loading..." status.</p>' +
84 '<p>"Play" button should turn into "Pause" when playing, with current and remaining time should changing and the thumb ' +
85 'of the timeline gliding smoothly along the track, updated every 200ms or so.</p>',
86 html
: '<video controls src={video}></video>',
89 title
: 'Typical audio with controls',
90 description
: '<p>Should have "Rewind", "Play", "Mute" buttons, timeline with time current and remaining shown.</p>' +
91 '<p>You may see brief resize of the video when the metadata arrives and a brief flash of the "Loading..." status.</p>' +
92 '<p>"Play" button should turn into "Pause" when playing, with current and remaining time should changing and the thumb ' +
93 'of the timeline gliding smoothly along the track, updated every 200ms or so.</p>',
94 html
: '<audio controls src={audio}></audio>',
97 title
: 'Video volume controls',
98 description
: '<p>When hovering over the "Mute" button, a volume control should appear, showing its own "Mute" button and a volume slider.</p>' +
99 '<p>You should be able to control the volume with the slider and mute/unmute using the "Mute" button</p>' +
100 '<p>Moving the mouse away from the volume control should make the control disappear.</p>',
101 html
: '<video controls src={video}></video>',
104 title
: 'Audio volume controls',
105 description
: '<p>When hovering over the "Mute" button, a volume control should appear, showing its own "Mute" button and a volume slider.</p>' +
106 '<p>You should be able to control the volume with the slider and mute/unmute using the "Mute" button</p>' +
107 '<p>Moving the mouse away from the volume control should make the control disappear.</p>',
108 html
: '<audio style="padding-top: 200px;" controls src={video}></audio>',
110 'audio-volume-neg': {
111 title
: 'Audio volume controls (negative offset)',
112 description
: '<p>When hovering over the "Mute" button, a volume control should appear, showing its own "Mute" button and a volume slider.</p>' +
113 '<p>In this particular layout, the volume control should be positioned directly under the "Mute" button, showing two "Mute" buttons --' +
114 'one on the main controls and another on the volume control.</p>' +
115 '<p>You should be able to control the volume with the slider and mute/unmute using the "Mute" button</p>' +
116 '<p>Moving the mouse away from the volume control or the "Mute" button should make the control disappear.</p>',
117 html
: '<audio controls src={video}></audio>',
120 title
: 'Magnified video',
121 description
: '<p>Should have the same appearance as a typical video, except magnified 1.5 times.</p>' +
122 '<p>Make sure that the appearance of controls does not changed when changing the page zoom.</p>',
123 html
: '<video controls src={video} style="zoom:150%"></video>',
126 title
: 'Fading video controls',
127 description
: '<p>When the video is playing, the controls should fade out when the mouse is away from the video and fade back in when the mouse is over the video.</p>' +
128 '<p>The controls should not fade when the video is paused.</p>',
129 html
: '<video controls src={video} autoplay></video>',
132 title
: 'Timeline reacting to a resize',
133 description
: '<p>When changing the width of the screen, the timeline should be the only one part of the controls changing its width.</p>' +
134 '<p>At a certain minimum point, the current and remaining time should disappear, giving up their space to the timeline.</p>' +
135 '<p>Conversely, when sizing the width up, the current and remaining time should come back into their places.',
136 html
: '<video controls src={video} style="width:60%"></video>',
139 title
: 'Toggling video controls',
140 description
: '<p>When clicking on "Toggle Controls" button, the controls should appear and disappear.</p>' +
141 '<p>The controls should have "Rewind", "Play", "Mute" buttons, timeline with time current and remaining shown.</p>',
142 js: function(click
) {
146 var video
= document
.getElementsByTagName('video')[0];
147 video
.controls
= !video
.controls
;
149 html
: '<video src={video}></video><br><button onclick="test(true)">Toggle Controls</button>',
151 'toggle-controls-autoplay': {
152 title
: 'Toggling video controls while playing',
153 description
: '<p>When clicking on "Toggle Controls" button, the controls should appear and disappear.</p>' +
154 '<p>The controls should have "Rewind", "Pause", "Mute" buttons, timeline with time current and remaining shown,' +
155 'with current and remaining time should changing and the thumb of the timeline gliding smoothly along the track, updated every 200ms or so.</p>' +
156 '<p>The controls should fade quickly if the mouse is not over the video.</p>',
157 js: function(click
) {
161 var video
= document
.getElementsByTagName('video')[0];
162 video
.controls
= !video
.controls
;
164 html
: '<video src={video} autoplay></video><br><button onclick="test(true)">Toggle Controls</button>',
167 title
: 'Video with invalid media',
168 description
: 'Should have "Rewind" and "Play" buttons, and "Loading..." status ' +
169 'if supported. Should blink "Loading...", but not twitch or flash other controls if reloaded',
170 html
: '<video controls src="foobar"></video>'
173 title
: 'Video with no source',
174 description
: 'Should have "Rewind" and "Play" buttons. Should not blink/twitch if reloaded.',
175 html
: '<video controls></video>'
178 title
: 'Audio with no source',
179 description
: 'Should have "Rewind" and "Play" buttons. Should not blink/twitch if reloaded.',
180 html
: '<audio controls></audio>'
182 'controls-buffer-update': {
183 title
: 'Buffer progress bar updates',
184 description
: '<p>The buffer progress bar should continue to update prior to video playback.</p>' +
185 '<p>Verify the progress bar representing the amount of video buffered continues to ' +
186 'update prior to video playback. Keep the mouse pointer off the progress bar during this check ' +
187 'as movement over the control will trigger a repaint which invalidates the test.</p><p>' +
188 'It\'s expected that the video may stop buffering before the entire video is loaded.</p>',
189 html
: '<video controls src="http://movies.apple.com/movies/us/apple/ipoditunes/2007/touch/ads/apple_ipodtouch_touch_640x360.mov' +
190 '?prevent_caching=' + new Date().getTime() + '"></video>'
195 function configureMediaFiles()
198 'audio': absoluteUrl(findMediaFile('audio', MEDIA_FILES_LOCATION
+ '/test')),
199 'video': absoluteUrl(findMediaFile('video', MEDIA_FILES_LOCATION
+ '/test')),
200 'video-captioned': absoluteUrl(MEDIA_FILES_LOCATION
+ '/counting-captioned.mov')
203 // FIXME: Add error reporting when resolving these fails.
205 function absoluteUrl(url
)
207 var a
= document
.createElement('a');
209 return '"' + a
.href
+ '"';
215 var test
= TESTS
[location
.hash
.substr(1)];
219 var arena
= document
.getElementById('arena');
220 document
.getElementById('description').innerHTML
= '<h2>' + test
.title
+ '</h2>' + test
.description
;
222 arena
.contentDocument
.body
.innerHTML
= test
.html
.replace(/{([\w-]+)}/g, function(s
, type
)
224 return (MEDIA_FILES
[type
] || '');
228 arena
.contentDocument
.body
.appendChild(arena
.contentDocument
.createElement('script')).textContent
= 'window.test = ' + (test
.js
? String(test
.js
) : 'function() {}') + ';\nwindow.test()';
231 window
.addEventListener('hashchange', runTest
, false);
233 window
.addEventListener('DOMContentLoaded', function()
235 configureMediaFiles();
237 var list
= document
.getElementById('list').appendChild(document
.createElement('ul'));
238 for(var key
in TESTS
)
239 list
.appendChild(document
.createElement('li')).innerHTML
= '<a href="#' + key
+ '" id="' + key
+ '">' + TESTS
[key
].title
+ '</a>';
247 <h1>Manual Tests of Media Controls Appearance
</h1>
250 <iframe id=
"arena"></iframe>
251 <div id=
"description"></div>