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

Unified Diff: third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html

Issue 2077413002: Convert video-duration*, video-error* and video-load* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 6 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/video-error-does-not-exist.html
diff --git a/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html b/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html
index 777ac8e2adb8de6c75015f2115cac2f4d4beca76..85e7e7040617856de6a6d2d261dcad10fe0318d9 100644
--- a/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html
+++ b/third_party/WebKit/LayoutTests/media/video-error-does-not-exist.html
@@ -1,29 +1,28 @@
-<p>Test that the media element is in correct state after load fails.</p>
-<video controls></video>
-<!-- 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 the media element is in correct state after load fails.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<video></video>
<script>
+async_test(function(t) {
+ var video = document.querySelector("video");
+ assert_equals(video.error, null);
- consoleWrite("");
- testExpected("video.error", null);
+ video.oncanplaythrough = t.unreached_func();
- waitForEventAndTest("canplaythrough", "false");
+ video.onerror = t.step_func_done(function () {
+ assert_not_equals(video.error, null);
+ assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
- waitForEvent("error", function () {
- testExpected("video.error", null, "!=");
- testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
+ assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
- testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE);
-
- testExpected("isNaN(video.duration)", true);
- testExpected("video.currentTime", 0);
- testExpected("video.buffered.length", 0);
- testExpected("video.seekable.length", 0);
- testExpected("video.buffered.length", 0);
- endTest();
+ assert_true(isNaN(video.duration));
+ assert_equals(video.currentTime, 0);
+ assert_equals(video.buffered.length, 0);
+ assert_equals(video.seekable.length, 0);
+ assert_equals(video.buffered.length, 0);
});
video.src = "content/does-not-exist.mpeg";
- consoleWrite("");
-</script>
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698