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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html

Issue 2174143002: Convert video-query* and video-reference* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-query-url-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-query-url.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
index 688f712cdfeb58c9d4a7d73ce6cff408c008558f..e4255a449844e4e2613fc155800e2810e4baba44 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-query-url.html
@@ -1,36 +1,24 @@
-<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 a media file specified with a query url is opened successfully.</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>
+async_test(function(t) {
+ var iframe = document.createElement('iframe');
- var movie = findMediaFile('video', 'test');
- var type = mimeTypeForExtension(movie.split('.').pop());
- var frame = document.createElement('iframe');
+ iframe.onload = t.step_func(function() {
+ var movie = findMediaFile('video', 'test');
+ var type = mimeTypeForExtension(movie.split('.').pop());
+ var video = document.querySelector('video');
+ video.onerror = t.unreached_func();
+ video.oncanplay = t.step_func_done();
+ video.src = 'http://127.0.0.1:8000/media/resources/load-video.php?name=' + movie + '&type=' + type;
+ });
- frame.width = 0;
- frame.height = 0;
- frame.addEventListener('load', function () {
- video.src = 'http://127.0.0.1:8000/media/resources/load-video.php?name=' + movie + '&type=' + type;
-
- waitForEventAndFail('error');
- waitForEventAndEnd('canplay');
- });
-
- frame.src = "data:text/html,<b>test</b>";
- document.body.appendChild(frame);
- }
- </script>
- </head>
-
- <body onload="loadMediaFrame()">
- <video controls></video>
- <br>
- Tests that WebKit is able to open a media file specified with a query url.
- </body>
-</html>
+ iframe.src = 'data:text/html,<b>test</b>';
+ document.body.appendChild(iframe);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/video-query-url-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698