Chromium Code Reviews| 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'); |
|
Srirama
2016/07/20 14:46:56
these events are added to "document" and they are
|
| - 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> |