Index: third_party/WebKit/LayoutTests/media/broken-video.html |
diff --git a/third_party/WebKit/LayoutTests/media/broken-video.html b/third_party/WebKit/LayoutTests/media/broken-video.html |
index 9fecca3d462cc4a85a632269a5dc35306e21912f..3c477ef942cc3179231d0a9e3fdc0dff95446420 100644 |
--- a/third_party/WebKit/LayoutTests/media/broken-video.html |
+++ b/third_party/WebKit/LayoutTests/media/broken-video.html |
@@ -1,16 +1,17 @@ |
-<video controls></video> |
-<p>Test that an invalid video file generates a MEDIA_ERR_SRC_NOT_SUPPORTED error and sets networkState to NETWORK_NO_SOURCE.</p> |
-<script src=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=video-test.js></script> |
- |
+<!DOCTYPE HTML> |
+<title>Test that an invalid video file generates a MEDIA_ERR_SRC_NOT_SUPPORTED error and sets networkState to NETWORK_NO_SOURCE.</title> |
+<script src="media-file.js"></script> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<video></video> |
<script> |
+async_test(function(t) { |
+ var video = document.querySelector("video"); |
video.src = findMediaFile("video", "content/garbage"); |
- waitForEvent("error", function () { |
- testExpected("video.error", "[object MediaError]"); |
- testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); |
- testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE); |
- endTest(); |
+ video.onerror = t.step_func_done(function () { |
+ assert_true(video.error instanceof MediaError); |
+ assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); |
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); |
}); |
+}); |
</script> |