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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html

Issue 2180713002: Convert video-load* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures 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
Index: third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
index 901454184e6626d8f34257ac99b1ecf29747a60f..34bac025669bba6bcc8d3235078ac1e2aa54917f 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-load-with-userpass.html
@@ -1,40 +1,29 @@
-<html>
- <head>
- <!-- 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>
- <script>
- function loadMediaFrame()
- {
- findMediaElement();
+<!DOCTYPE html>
+<title>Tests that the media player does not include authorization information.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
+<body>
+<video>
+ <source></source>
+</video>
+<script>
+async_test(function(t) {
+ var frame = document.createElement('iframe');
+ frame.onload = t.step_func(function() {
+ var video = document.querySelector('video');
+ video.onerror = t.unreached_func();
+ video.oncanplay = t.step_func_done();
- var movie = findMediaFile('video', 'test');
- var type = mimeTypeForExtension(movie.split('.').pop());
- var frame = document.createElement('iframe');
- frame.width = 0;
- frame.height = 0;
- frame.addEventListener('load', function () {
- source = document.getElementById('source');
- source.src = 'http://user:pass@127.0.0.1:8080/media/resources/video-check-userpass.php?name=' + movie + '&type=' + type;
- source.type = type;
+ var movie = findMediaFile('video', 'test');
+ var type = mimeTypeForExtension(movie.split('.').pop());
+ source = document.querySelector('source');
+ source.type = type;
+ source.src = 'http://user:pass@127.0.0.1:8080/media/resources/video-check-userpass.php?name=' + movie + '&type=' + type;
+ video.load();
+ });
- waitForEventAndFail('error');
- waitForEventAndEnd('canplay');
- video.load();
- });
-
- frame.src = "data:text/html,<b>test</b>";
- document.body.appendChild(frame);
- }
- </script>
- </head>
-
- <body onload="loadMediaFrame()">
- <video id="video">
- <source id="source">
- </video>
- <br>
- Tests that the media player does not include authorization information.
- </body>
-</html>
+ frame.src = 'data:text/html,<b>test</b>';
+ document.body.appendChild(frame);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698