Index: third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html |
index 27f23d5a78a39a1b15df71b01dace19fd42d512b..edae717ead0349357033cd3b5250b17e948466b6 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/media/remove-while-loading.html |
@@ -1,18 +1,20 @@ |
+<!DOCTYPE html> |
+<title>Test that removing a media element from the tree while loading does not crash.</title> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<script src="../../media-resources/media-file.js"></script> |
<video></video> |
-<p>Test that removing a media element from the tree while loading does not crash.</p> |
-<script src=../../media-resources/media-file.js></script> |
-<!-- 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> |
-waitForEvent('loadedmetadata', function () { |
- run("document.body.removeChild(video)"); |
- endTestLater(); |
-} ); |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
-// Find a supported media file. |
-var mediaFile = findMediaFile("video", "content/test"); |
-var mimeType = mimeTypeForFile(mediaFile); |
+ video.onloadedmetadata = t.step_func(function() { |
+ document.body.removeChild(video); |
+ setTimeout(t.step_func_done(), 100); |
+ }); |
-video.src = "http://127.0.0.1:8000/resources/load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000"; |
-</script> |
+ var mediaFile = findMediaFile("video", "content/test"); |
+ var mimeType = mimeTypeForFile(mediaFile); |
+ video.src = "http://127.0.0.1:8000/resources/load-and-stall.cgi?name=../../../media/" + mediaFile + "&mimeType=" + mimeType + "&stallAt=100000"; |
+}); |
+</script> |