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

Side by Side 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: fix 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 unified diff | Download patch
OLDNEW
1 <p>Test that the media element is in correct state after load fails.</p> 1 <!DOCTYPE HTML>
2 <video controls></video> 2 <title>Test that the media element is in correct state after load fails.</title>
3 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 3 <script src="../resources/testharness.js"></script>
4 (Please avoid writing new tests using video-test.js) --> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src=video-test.js></script> 5 <video></video>
6 <script> 6 <script>
7 async_test(function(t) {
8 var video = document.querySelector("video");
9 assert_equals(video.error, null);
7 10
8 consoleWrite(""); 11 video.onerror = t.step_func_done(function () {
9 testExpected("video.error", null); 12 assert_not_equals(video.error, null);
13 assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
10 14
11 waitForEventAndTest("canplaythrough", "false"); 15 assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
fs 2016/06/20 14:32:25 (I wonder if this was intended as an "unreachable"
Srirama 2016/06/21 05:07:40 Done.
12 16
13 waitForEvent("error", function () { 17 assert_true(isNaN(video.duration));
14 testExpected("video.error", null, "!="); 18 assert_equals(video.currentTime, 0);
15 testExpected("video.error.code", MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) ; 19 assert_equals(video.buffered.length, 0);
16 20 assert_equals(video.seekable.length, 0);
17 testExpected("video.networkState", HTMLMediaElement.NETWORK_NO_SOURCE); 21 assert_equals(video.buffered.length, 0);
18
19 testExpected("isNaN(video.duration)", true);
20 testExpected("video.currentTime", 0);
21 testExpected("video.buffered.length", 0);
22 testExpected("video.seekable.length", 0);
23 testExpected("video.buffered.length", 0);
24 endTest();
25 }); 22 });
26 23
27 video.src = "content/does-not-exist.mpeg"; 24 video.src = "content/does-not-exist.mpeg";
28 consoleWrite(""); 25 });
29 </script> 26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698