Chromium Code Reviews| 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..cc259760200f546bbd6e0f468578107e0e2a8666 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,26 @@ |
| -<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.onerror = t.step_func_done(function () { |
| + assert_not_equals(video.error, null); |
| + assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); |
| - waitForEventAndTest("canplaythrough", "false"); |
|
fs
2016/06/20 14:32:25
(I wonder if this was intended as an "unreachable"
Srirama
2016/06/21 05:07:40
Done.
|
| + assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); |
| - waitForEvent("error", function () { |
| - testExpected("video.error", null, "!="); |
| - testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); |
| - |
| - 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> |