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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/media-document.html

Issue 2167743002: Convert media-document* and pdf* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add suggested change 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/media-document-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/media-document.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
index 92690242ee18ea0818705e13aa1e9211e72a3e91..e29eac4a7b656c1c173d5051113df6505ccb5c65 100644
--- a/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
+++ b/third_party/WebKit/LayoutTests/http/tests/media/media-document.html
@@ -1,31 +1,20 @@
-<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>
- var frame;
- function loadMediaFrame()
- {
- var movie = findMediaFile('video', 'test');
- var type = mimeTypeForExtension(movie.split('.').pop());
- frame = document.createElement('iframe');
- frame.addEventListener('load', function () {
- testExpected("frame.contentDocument.getElementsByTagName('video')[0].error", null);
- endTest();
- });
- waitForEventAndFail('error');
- waitForEventAndEnd('canplay');
- frame.src = 'resources/video-check-useragent.php?name=' + movie + '&type=' + type;
- document.body.appendChild(frame);
- }
- </script>
- </head>
+<!DOCTYPE html>
+<title>Tests that a media document can open a media URL with an ambiguous extension.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
+<body>
+<script>
+async_test(function(t) {
+ var movie = findMediaFile('video', 'test');
+ var type = mimeTypeForExtension(movie.split('.').pop());
+ var iframe = document.createElement('iframe');
- <body onload="loadMediaFrame()">
- <br>
- Tests that a media document can open a media URL with an ambiguous extension.
- <br>
- </body>
-</html>
+ iframe.onload = t.step_func_done(function() {
+ assert_equals(iframe.contentDocument.querySelector('video').error, null);
+ });
+
+ iframe.src = 'resources/video-check-useragent.php?name=' + movie + '&type=' + type;
+ document.body.appendChild(iframe);
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/media/media-document-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698