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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« 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