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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html

Issue 2179483002: Convert video-cookie* and video-error* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use EventWatcher to simplify the test Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-cookie-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-cookie-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698