4 <title>video-load-with-authentication</title>
5 <script src="../../LayoutTests/media/video-test.js" type="text/javascript"></script>
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 challenge. To use this test case you should setup your apache2 http server
11 with http authentication support first.<br>
13 <h3>Ways to setup the apache2 http server with http authentication support</h3>
15 <li>Add "AllowOverride AuthConfig" to <Directory> setting in your site 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>
24 <li>Put your test video file into this directory, and restart your apache2 http server.</li>
26 <p>More information about configuring apache2 http authentication, please refer to apache 2.0 document: <a href="http://httpd.apache.org/docs/2.0/howto/auth.html">Authentication, Authorization and Access Control</a>.</p>
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 area below;</li>
33 <li>Then press load button, and fill the authentication challenge pop up dialog with the credential information created before, then wait for the result.</li>
40 <input type="url" id="url" name="videoSrc" size="100"></input><br>
41 <input type="button" value="Load" onclick="load()" />
43 <video id="video" hidden="hidden"></video>
44 <script type="text/javascript">
47 logResult(true, "Video file successfully loaded, test case passed.");
53 failTest("Load video file error, test case failed.");
59 waitForEvent("loadstart");
60 waitForEvent("loadeddata", onLoaded);
61 waitForEvent("error", onError);
63 mediaElement.src = document.getElementById("url").value;