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

Unified Diff: third_party/WebKit/LayoutTests/media/broken-video.html

Issue 2019643002: Convert before-*, broken-* and constructors.html tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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
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>

Powered by Google App Engine
This is Rietveld 408576698