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

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

Issue 2660003003: Add MediaError.message (Closed)
Patch Set: Address dalecurtis@'s comment: undef STRINGIFY_STATUS_CASE Created 3 years, 8 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 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <title>Test that the media element is in correct state after load fails.</title> 2 <title>Test that the media element is in correct state after load fails.</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <video></video> 5 <video></video>
6 <script> 6 <script>
7 async_test(function(t) { 7 async_test(function(t) {
8 var video = document.querySelector("video"); 8 var video = document.querySelector("video");
9 assert_equals(video.error, null); 9 assert_equals(video.error, null);
10 10
11 video.oncanplaythrough = t.unreached_func(); 11 video.oncanplaythrough = t.unreached_func();
12 12
13 video.onerror = t.step_func_done(function () { 13 video.onerror = t.step_func_done(function () {
14 assert_not_equals(video.error, null); 14 assert_not_equals(video.error, null);
15 assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED); 15 assert_equals(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
16 16
17 // Actual message can vary greatly, so we only verify the attribute's ty pe.
18 assert_equals(typeof video.error.message, 'string', 'MediaError.message type');
19
17 assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE); 20 assert_equals(video.networkState, HTMLMediaElement.NETWORK_NO_SOURCE);
18 21
19 assert_true(isNaN(video.duration)); 22 assert_true(isNaN(video.duration));
20 assert_equals(video.currentTime, 0); 23 assert_equals(video.currentTime, 0);
21 assert_equals(video.buffered.length, 0); 24 assert_equals(video.buffered.length, 0);
22 assert_equals(video.seekable.length, 0); 25 assert_equals(video.seekable.length, 0);
23 assert_equals(video.buffered.length, 0); 26 assert_equals(video.buffered.length, 0);
24 }); 27 });
25 28
26 video.src = "content/does-not-exist.mpeg"; 29 video.src = "content/does-not-exist.mpeg";
27 }); 30 });
28 </script> 31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698