OLD | NEW |
1 <html> | 1 <!DOCTYPE html> |
2 <head> | 2 <title>Tests that the media player will send the relevant cookies when requestin
g the media file.</title> |
3 </head> | 3 <script src="../resources/testharness.js"></script> |
4 <body onload="loadCookie()"> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <video id="video"></video> | 5 <script src="../../media-resources/media-file.js"></script> |
6 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 6 <body> |
7 (Please avoid writing new tests using video-test.js) --> | 7 <video></video> |
8 <script src=../../media-resources/video-test.js></script> | |
9 <script src=../../media-resources/media-file.js></script> | |
10 <script> | 8 <script> |
11 if (window.testRunner) { | 9 async_test(function(t) { |
12 testRunner.dumpAsText(); | 10 var movie = findMediaFile("video", "resources/test"); |
13 testRunner.setBlockThirdPartyCookies(false); | 11 var frame = document.createElement("iframe"); |
14 testRunner.waitUntilDone(); | 12 document.body.appendChild(frame); |
15 } | |
16 | 13 |
17 function loadCookie () { | 14 frame.onload = t.step_func(function() { |
18 var movie = findMediaFile("video", "resources/test"); | 15 var video = document.querySelector("video"); |
19 var frame = document.createElement("iframe"); | 16 video.src="http://127.0.0.1:8000/media/resources/video-cookie-check-cook
ie.php"; |
20 document.body.appendChild(frame); | 17 video.oncanplay = t.step_func_done(); |
| 18 video.play(); |
| 19 }); |
21 | 20 |
22 frame.addEventListener('load', function () { | 21 frame.src = "http://127.0.0.1:8000/media/resources/setCookie.cgi?name=" + mo
vie; |
23 video = document.getElementById('video'); | 22 }); |
24 video.src="http://127.0.0.1:8000/media/resources/video-cookie-ch
eck-cookie.php"; | 23 </script> |
25 video.play(); | |
26 }); | |
27 | |
28 frame.width = 0; | |
29 frame.height = 0; | |
30 frame.src = "http://127.0.0.1:8000/media/resources/setCookie.cgi?name="
+ movie; | |
31 } | |
32 | |
33 waitForEvent("canplay", function () { | |
34 if (window.testRunner) | |
35 window.testRunner.notifyDone(); | |
36 } ); | |
37 </script> | |
38 Tests that the media player will send the relevant cookies when requesting the m
edia file.<br/> | |
39 </body> | |
40 </html> | |
OLD | NEW |