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

Side by Side Diff: chrome/test/data/media/player.html

Issue 9666032: Cleanup deprecated PyAuto media tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « chrome/test/data/media/html/player.js ('k') | chrome/test/data/media/swfobject.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <body>
3 <div id="player_container"></div>
4 <script>
5 var player = null;
6 function InstallEventHandler(event, action) {
7 player.addEventListener(event, function(e) {
8 eval(action);
9 }, false);
10 }
11
12 // Parse the location and load the media file accordingly.
13 var url = window.location.href;
14 var url_parts = url.split('?');
15
16 // Make sure the URL is of the form "player.html?query".
17 var ok = false;
18 if (url_parts.length > 1) {
19 var query = url_parts[1];
20 var query_parts = query.split('=');
21 if (query_parts.length == 2) {
22 var tag = query_parts[0];
23 var media_url = query_parts[1];
24 if (tag == 'audio' || tag == 'video') {
25 ok = true;
26 var container = document.getElementById('player_container');
27 container.innerHTML = '<' + tag + ' controls id="player"></' + tag + '>';
28 player = document.getElementById('player');
29
30 // Install event handlers.
31 InstallEventHandler('error',
32 'document.title = "ERROR = " + player.error.code');
33 InstallEventHandler('playing', 'document.title = "PLAYING"');
34
35 // Starts the player.
36 player.src = media_url;
37 player.play();
38 }
39 }
40 }
41 if (!ok) {
42 document.title = 'FAILED';
43 }
44 </script>
45 </body>
46 </html>
OLDNEW
« no previous file with comments | « chrome/test/data/media/html/player.js ('k') | chrome/test/data/media/swfobject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698