Index: third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html |
index 7a73dba777f52a41dfa862f2a1f0c7f6078fe153..7478c13e7ca32f4b29017c0ff99eb43944b739c0 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-cookie.html |
@@ -1,40 +1,23 @@ |
-<html> |
-<head> |
-</head> |
-<body onload="loadCookie()"> |
-<video id="video"></video> |
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
-<script src=../../media-resources/video-test.js></script> |
-<script src=../../media-resources/media-file.js></script> |
+<!DOCTYPE html> |
+<title>Tests that the media player will send the relevant cookies when requesting the media file.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="../../media-resources/media-file.js"></script> |
+<body> |
+<video></video> |
<script> |
- if (window.testRunner) { |
- testRunner.dumpAsText(); |
- testRunner.setBlockThirdPartyCookies(false); |
- testRunner.waitUntilDone(); |
- } |
+async_test(function(t) { |
+ var movie = findMediaFile("video", "resources/test"); |
+ var frame = document.createElement("iframe"); |
+ document.body.appendChild(frame); |
- function loadCookie () { |
- var movie = findMediaFile("video", "resources/test"); |
- var frame = document.createElement("iframe"); |
- document.body.appendChild(frame); |
+ frame.onload = t.step_func(function() { |
+ var video = document.querySelector("video"); |
+ video.src="http://127.0.0.1:8000/media/resources/video-cookie-check-cookie.php"; |
+ video.oncanplay = t.step_func_done(); |
+ video.play(); |
+ }); |
- frame.addEventListener('load', function () { |
- video = document.getElementById('video'); |
- video.src="http://127.0.0.1:8000/media/resources/video-cookie-check-cookie.php"; |
- video.play(); |
- }); |
- |
- frame.width = 0; |
- frame.height = 0; |
- frame.src = "http://127.0.0.1:8000/media/resources/setCookie.cgi?name=" + movie; |
- } |
- |
- waitForEvent("canplay", function () { |
- if (window.testRunner) |
- window.testRunner.notifyDone(); |
- } ); |
-</script> |
-Tests that the media player will send the relevant cookies when requesting the media file.<br/> |
-</body> |
-</html> |
+ frame.src = "http://127.0.0.1:8000/media/resources/setCookie.cgi?name=" + movie; |
+}); |
+</script> |