| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>video-load-with-authentication</title> | |
| 5 <script src="../../LayoutTests/media/video-test.js" type="text/javascript"><
/script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <p> | |
| 9 This test case is for <a href="https://bugs.webkit.org/show_bug.cgi?id=84214">
https://bugs.webkit.org/show_bug.cgi?id=84214</a><br> | |
| 10 This test case is aming at testing video loading with http authentication chal
lenge. To use this test case you should setup your apache2 http server | |
| 11 with http authentication support first.<br> | |
| 12 <p> | |
| 13 <h3>Ways to setup the apache2 http server with http authentication support</
h3> | |
| 14 <ol> | |
| 15 <li>Add "AllowOverride AuthConfig" to <Directory> setting in your si
te configuration file;</li> | |
| 16 <li>Create the password file using command: <code>htpasswd -c <passord_
filename> <username></code>, and put this file into <ServerRoot>;
</li> | |
| 17 <li>Create a directory under your server <Directory>, and create the
file .htaccess in this directory;</li> | |
| 18 <li>Configure the .htaccess file with the following content: | |
| 19 <pre>AuthType <Basic|Digest> | |
| 20 AuthName "Video HTTP Authentication" | |
| 21 AuthUserFile </path/to/the/password/file> | |
| 22 Require user <username></pre> | |
| 23 </li> | |
| 24 <li>Put your test video file into this directory, and restart your apache2
http server.</li> | |
| 25 </ol> | |
| 26 <p>More information about configuring apache2 http authentication, please re
fer to apache 2.0 document: <a href="http://httpd.apache.org/docs/2.0/howto/auth
.html">Authentication, Authorization and Access Control</a>.</p> | |
| 27 </p> | |
| 28 <p> | |
| 29 <h3>Ways to test</h3> | |
| 30 <ol> | |
| 31 <li>Setup your apache2 http server and prepare the video file as mentioned
above;</li> | |
| 32 <li>Enter the link pointing to the video file in the "Video Source" text a
rea below;</li> | |
| 33 <li>Then press load button, and fill the authentication challenge pop up d
ialog with the credential information created before, then wait for the result.<
/li> | |
| 34 </ol> | |
| 35 </p> | |
| 36 </p> | |
| 37 <hr /> | |
| 38 <div> | |
| 39 Video Source: | |
| 40 <input type="url" id="url" name="videoSrc" size="100"></input><br> | |
| 41 <input type="button" value="Load" onclick="load()" /> | |
| 42 </div> | |
| 43 <video id="video" hidden="hidden"></video> | |
| 44 <script type="text/javascript"> | |
| 45 function onLoaded() | |
| 46 { | |
| 47 logResult(true, "Video file successfully loaded, test case passed."); | |
| 48 endTest(); | |
| 49 } | |
| 50 | |
| 51 function onError() | |
| 52 { | |
| 53 failTest("Load video file error, test case failed."); | |
| 54 } | |
| 55 | |
| 56 function load() | |
| 57 { | |
| 58 findMediaElement(); | |
| 59 waitForEvent("loadstart"); | |
| 60 waitForEvent("loadeddata", onLoaded); | |
| 61 waitForEvent("error", onError); | |
| 62 | |
| 63 mediaElement.src = document.getElementById("url").value; | |
| 64 mediaElement.load(); | |
| 65 } | |
| 66 </script> | |
| 67 </body> | |
| 68 </html> | |
| OLD | NEW |