gecko/content/media/test/test_constants.html
Matthew Gregan f202e48bf0 Bug 481057 - Fire MEDIA_ERR_DECODE errors when a decoding error occurs. r=chris.double, sr=roc
--HG--
extra : rebase_source : a07687f16726086dd425eef8907788019beebbe1
2009-09-22 12:08:13 +12:00

245 lines
13 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
Adapted from:
http://simon.html5.org/test/html/dom/interfaces/htmlelement/htmlmediaelement/const-unsigned-short/001.htm
-->
<head>
<title>Media test: constants</title>
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<video onerror="event.stopPropagation();"><source></video><audio onerror="event.stopPropagation();"><source></audio>
<pre id="test">
<script class="testbody" type="text/javascript">
is(HTMLElement.NETWORK_EMPTY, undefined);
is(HTMLElement.NETWORK_IDLE, undefined);
is(HTMLElement.NETWORK_LOADING, undefined);
is(HTMLElement.NETWORK_LOADED, undefined);
is(HTMLElement.NETWORK_NO_SOURCE, undefined);
is(HTMLElement.HAVE_NOTHING, undefined);
is(HTMLElement.HAVE_METADATA, undefined);
is(HTMLElement.HAVE_CURRENT_DATA, undefined);
is(HTMLElement.HAVE_FUTURE_DATA, undefined);
is(HTMLElement.HAVE_ENOUGH_DATA, undefined);
is(HTMLElement.MEDIA_ERR_ABORTED, undefined);
is(HTMLElement.MEDIA_ERR_NETWORK, undefined);
is(HTMLElement.MEDIA_ERR_DECODE, undefined);
is(HTMLElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLMediaElement.NETWORK_EMPTY, 0);
is(HTMLMediaElement.NETWORK_IDLE, 1);
is(HTMLMediaElement.NETWORK_LOADING, 2);
is(HTMLMediaElement.NETWORK_LOADED, 3);
is(HTMLMediaElement.NETWORK_NO_SOURCE, 4);
is(HTMLMediaElement.HAVE_NOTHING, 0);
is(HTMLMediaElement.HAVE_METADATA, 1);
is(HTMLMediaElement.HAVE_CURRENT_DATA, 2);
is(HTMLMediaElement.HAVE_FUTURE_DATA, 3);
is(HTMLMediaElement.HAVE_ENOUGH_DATA, 4);
is(HTMLMediaElement.MEDIA_ERR_ABORTED, undefined);
is(HTMLMediaElement.MEDIA_ERR_NETWORK, undefined);
is(HTMLMediaElement.MEDIA_ERR_DECODE, undefined);
is(HTMLMediaElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLVideoElement.NETWORK_EMPTY, undefined);
is(HTMLVideoElement.NETWORK_IDLE, undefined);
is(HTMLVideoElement.NETWORK_LOADING, undefined);
is(HTMLVideoElement.NETWORK_LOADED, undefined);
is(HTMLVideoElement.NETWORK_NO_SOURCE, undefined);
is(HTMLVideoElement.HAVE_NOTHING, undefined);
is(HTMLVideoElement.HAVE_METADATA, undefined);
is(HTMLVideoElement.HAVE_CURRENT_DATA, undefined);
is(HTMLVideoElement.HAVE_FUTURE_DATA, undefined);
is(HTMLVideoElement.HAVE_ENOUGH_DATA, undefined);
is(HTMLVideoElement.MEDIA_ERR_ABORTED, undefined);
is(HTMLVideoElement.MEDIA_ERR_NETWORK, undefined);
is(HTMLVideoElement.MEDIA_ERR_DECODE, undefined);
is(HTMLVideoElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLAudioElement.NETWORK_EMPTY, undefined);
is(HTMLAudioElement.NETWORK_IDLE, undefined);
is(HTMLAudioElement.NETWORK_LOADING, undefined);
is(HTMLAudioElement.NETWORK_LOADED, undefined);
is(HTMLAudioElement.NETWORK_NO_SOURCE, undefined);
is(HTMLAudioElement.HAVE_NOTHING, undefined);
is(HTMLAudioElement.HAVE_METADATA, undefined);
is(HTMLAudioElement.HAVE_CURRENT_DATA, undefined);
is(HTMLAudioElement.HAVE_FUTURE_DATA, undefined);
is(HTMLAudioElement.HAVE_ENOUGH_DATA, undefined);
is(HTMLAudioElement.MEDIA_ERR_ABORTED, undefined);
is(HTMLAudioElement.MEDIA_ERR_NETWORK, undefined);
is(HTMLAudioElement.MEDIA_ERR_DECODE, undefined);
is(HTMLAudioElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLSourceElement.NETWORK_EMPTY, undefined);
is(HTMLSourceElement.NETWORK_IDLE, undefined);
is(HTMLSourceElement.NETWORK_LOADING, undefined);
is(HTMLSourceElement.NETWORK_LOADED, undefined);
is(HTMLSourceElement.NETWORK_NO_SOURCE, undefined);
is(HTMLSourceElement.HAVE_NOTHING, undefined);
is(HTMLSourceElement.HAVE_METADATA, undefined);
is(HTMLSourceElement.HAVE_CURRENT_DATA, undefined);
is(HTMLSourceElement.HAVE_FUTURE_DATA, undefined);
is(HTMLSourceElement.HAVE_ENOUGH_DATA, undefined);
is(HTMLSourceElement.MEDIA_ERR_ABORTED, undefined);
is(HTMLSourceElement.MEDIA_ERR_NETWORK, undefined);
is(HTMLSourceElement.MEDIA_ERR_DECODE, undefined);
is(HTMLSourceElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLMediaError.NETWORK_EMPTY, undefined);
is(HTMLMediaError.NETWORK_IDLE, undefined);
is(HTMLMediaError.NETWORK_LOADING, undefined);
is(HTMLMediaError.NETWORK_LOADED, undefined);
is(HTMLMediaError.NETWORK_NO_SOURCE, undefined);
is(HTMLMediaError.HAVE_NOTHING, undefined);
is(HTMLMediaError.HAVE_METADATA, undefined);
is(HTMLMediaError.HAVE_CURRENT_DATA, undefined);
is(HTMLMediaError.HAVE_FUTURE_DATA, undefined);
is(HTMLMediaError.HAVE_ENOUGH_DATA, undefined);
is(HTMLMediaError.MEDIA_ERR_ABORTED, 1);
is(HTMLMediaError.MEDIA_ERR_NETWORK, 2);
is(HTMLMediaError.MEDIA_ERR_DECODE, 3);
is(HTMLMediaError.MEDIA_ERR_SRC_NOT_SUPPORTED, 4);
is(document.body.NETWORK_EMPTY, undefined);
is(document.body.NETWORK_IDLE, undefined);
is(document.body.NETWORK_LOADING, undefined);
is(document.body.NETWORK_LOADED, undefined);
is(document.body.NETWORK_NO_SOURCE, undefined);
is(document.body.HAVE_NOTHING, undefined);
is(document.body.HAVE_METADATA, undefined);
is(document.body.HAVE_CURRENT_DATA, undefined);
is(document.body.HAVE_FUTURE_DATA, undefined);
is(document.body.HAVE_ENOUGH_DATA, undefined);
is(document.body.MEDIA_ERR_ABORTED, undefined);
is(document.body.MEDIA_ERR_NETWORK, undefined);
is(document.body.MEDIA_ERR_DECODE, undefined);
is(document.body.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(document.getElementsByTagName("video")[0].NETWORK_EMPTY, 0);
is(document.getElementsByTagName("video")[0].NETWORK_IDLE, 1);
is(document.getElementsByTagName("video")[0].NETWORK_LOADING, 2);
is(document.getElementsByTagName("video")[0].NETWORK_LOADED, 3);
is(document.getElementsByTagName("video")[0].NETWORK_NO_SOURCE, 4);
is(document.getElementsByTagName("video")[0].HAVE_NOTHING, 0);
is(document.getElementsByTagName("video")[0].HAVE_METADATA, 1);
is(document.getElementsByTagName("video")[0].HAVE_CURRENT_DATA, 2);
is(document.getElementsByTagName("video")[0].HAVE_FUTURE_DATA, 3);
is(document.getElementsByTagName("video")[0].HAVE_ENOUGH_DATA, 4);
is(document.getElementsByTagName("video")[0].MEDIA_ERR_ABORTED, undefined);
is(document.getElementsByTagName("video")[0].MEDIA_ERR_NETWORK, undefined);
is(document.getElementsByTagName("video")[0].MEDIA_ERR_DECODE, undefined);
is(document.getElementsByTagName("video")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(document.getElementsByTagName("audio")[0].NETWORK_EMPTY, 0);
is(document.getElementsByTagName("audio")[0].NETWORK_IDLE, 1);
is(document.getElementsByTagName("audio")[0].NETWORK_LOADING, 2);
is(document.getElementsByTagName("audio")[0].NETWORK_LOADED, 3);
is(document.getElementsByTagName("audio")[0].NETWORK_NO_SOURCE, 4);
is(document.getElementsByTagName("audio")[0].HAVE_NOTHING, 0);
is(document.getElementsByTagName("audio")[0].HAVE_METADATA, 1);
is(document.getElementsByTagName("audio")[0].HAVE_CURRENT_DATA, 2);
is(document.getElementsByTagName("audio")[0].HAVE_FUTURE_DATA, 3);
is(document.getElementsByTagName("audio")[0].HAVE_ENOUGH_DATA, 4);
is(document.getElementsByTagName("audio")[0].MEDIA_ERR_ABORTED, undefined);
is(document.getElementsByTagName("audio")[0].MEDIA_ERR_NETWORK, undefined);
is(document.getElementsByTagName("audio")[0].MEDIA_ERR_DECODE, undefined);
is(document.getElementsByTagName("audio")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(document.getElementsByTagName("source")[0].NETWORK_EMPTY, undefined);
is(document.getElementsByTagName("source")[0].NETWORK_IDLE, undefined);
is(document.getElementsByTagName("source")[0].NETWORK_LOADING, undefined);
is(document.getElementsByTagName("source")[0].NETWORK_LOADED, undefined);
is(document.getElementsByTagName("source")[0].NETWORK_NO_SOURCE, undefined);
is(document.getElementsByTagName("source")[0].HAVE_NOTHING, undefined);
is(document.getElementsByTagName("source")[0].HAVE_METADATA, undefined);
is(document.getElementsByTagName("source")[0].HAVE_CURRENT_DATA, undefined);
is(document.getElementsByTagName("source")[0].HAVE_FUTURE_DATA, undefined);
is(document.getElementsByTagName("source")[0].HAVE_ENOUGH_DATA, undefined);
is(document.getElementsByTagName("source")[0].MEDIA_ERR_ABORTED, undefined);
is(document.getElementsByTagName("source")[0].MEDIA_ERR_NETWORK, undefined);
is(document.getElementsByTagName("source")[0].MEDIA_ERR_DECODE, undefined);
is(document.getElementsByTagName("source")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLElement.prototype.NETWORK_EMPTY, undefined);
is(HTMLElement.prototype.NETWORK_IDLE, undefined);
is(HTMLElement.prototype.NETWORK_LOADING, undefined);
is(HTMLElement.prototype.NETWORK_LOADED, undefined);
is(HTMLElement.prototype.NETWORK_NO_SOURCE, undefined);
is(HTMLElement.prototype.HAVE_NOTHING, undefined);
is(HTMLElement.prototype.HAVE_METADATA, undefined);
is(HTMLElement.prototype.HAVE_CURRENT_DATA, undefined);
is(HTMLElement.prototype.HAVE_FUTURE_DATA, undefined);
is(HTMLElement.prototype.HAVE_ENOUGH_DATA, undefined);
is(HTMLElement.prototype.MEDIA_ERR_ABORTED, undefined);
is(HTMLElement.prototype.MEDIA_ERR_NETWORK, undefined);
is(HTMLElement.prototype.MEDIA_ERR_DECODE, undefined);
is(HTMLElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
todo_is(HTMLMediaElement.prototype.NETWORK_EMPTY, 0, "HTMLMediaElement.prototype.NETWORK_EMPTY");
todo_is(HTMLMediaElement.prototype.NETWORK_IDLE, 1, "HTMLMediaElement.prototype.NETWORK_IDLE");
todo_is(HTMLMediaElement.prototype.NETWORK_LOADING, 2, "HTMLMediaElement.prototype.NETWORK_LOADING");
todo_is(HTMLMediaElement.prototype.NETWORK_LOADED, 3, "HTMLMediaElement.prototype.NETWORK_LOADED");
todo_is(HTMLMediaElement.prototype.NETWORK_NO_SOURCE, 4, "HTMLMediaElement.prototype.NETWORK_NO_SOURCE");
todo_is(HTMLMediaElement.prototype.HAVE_NOTHING, 0, "HTMLMediaElement.prototype.HAVE_NOTHING");
todo_is(HTMLMediaElement.prototype.HAVE_METADATA, 1, "HTMLMediaElement.prototype.HAVE_METADATA");
todo_is(HTMLMediaElement.prototype.HAVE_CURRENT_DATA, 2, "HTMLMediaElement.prototype.HAVE_CURRENT_DATA");
todo_is(HTMLMediaElement.prototype.HAVE_FUTURE_DATA, 3, "HTMLMediaElement.prototype.HAVE_FUTURE_DATA");
todo_is(HTMLMediaElement.prototype.HAVE_ENOUGH_DATA, 4, "HTMLMediaElement.prototype.HAVE_ENOUGH_DATA");
is(HTMLMediaElement.prototype.MEDIA_ERR_ABORTED, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_ABORTED");
is(HTMLMediaElement.prototype.MEDIA_ERR_NETWORK, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_NETWORK");
is(HTMLMediaElement.prototype.MEDIA_ERR_DECODE, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_DECODE");
is(HTMLMediaElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED");
is(HTMLVideoElement.prototype.NETWORK_EMPTY, 0);
is(HTMLVideoElement.prototype.NETWORK_IDLE, 1);
is(HTMLVideoElement.prototype.NETWORK_LOADING, 2);
is(HTMLVideoElement.prototype.NETWORK_LOADED, 3);
is(HTMLVideoElement.prototype.NETWORK_NO_SOURCE, 4);
is(HTMLVideoElement.prototype.HAVE_NOTHING, 0);
is(HTMLVideoElement.prototype.HAVE_METADATA, 1);
is(HTMLVideoElement.prototype.HAVE_CURRENT_DATA, 2);
is(HTMLVideoElement.prototype.HAVE_FUTURE_DATA, 3);
is(HTMLVideoElement.prototype.HAVE_ENOUGH_DATA, 4);
is(HTMLVideoElement.prototype.MEDIA_ERR_ABORTED, undefined);
is(HTMLVideoElement.prototype.MEDIA_ERR_NETWORK, undefined);
is(HTMLVideoElement.prototype.MEDIA_ERR_DECODE, undefined);
is(HTMLVideoElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLAudioElement.prototype.NETWORK_EMPTY, 0);
is(HTMLAudioElement.prototype.NETWORK_IDLE, 1);
is(HTMLAudioElement.prototype.NETWORK_LOADING, 2);
is(HTMLAudioElement.prototype.NETWORK_LOADED, 3);
is(HTMLAudioElement.prototype.NETWORK_NO_SOURCE, 4);
is(HTMLAudioElement.prototype.HAVE_NOTHING, 0);
is(HTMLAudioElement.prototype.HAVE_METADATA, 1);
is(HTMLAudioElement.prototype.HAVE_CURRENT_DATA, 2);
is(HTMLAudioElement.prototype.HAVE_FUTURE_DATA, 3);
is(HTMLAudioElement.prototype.HAVE_ENOUGH_DATA, 4);
is(HTMLAudioElement.prototype.MEDIA_ERR_ABORTED, undefined);
is(HTMLAudioElement.prototype.MEDIA_ERR_NETWORK, undefined);
is(HTMLAudioElement.prototype.MEDIA_ERR_DECODE, undefined);
is(HTMLAudioElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLSourceElement.prototype.NETWORK_EMPTY, undefined);
is(HTMLSourceElement.prototype.NETWORK_IDLE, undefined);
is(HTMLSourceElement.prototype.NETWORK_LOADING, undefined);
is(HTMLSourceElement.prototype.NETWORK_LOADED, undefined);
is(HTMLSourceElement.prototype.NETWORK_NO_SOURCE, undefined);
is(HTMLSourceElement.prototype.HAVE_NOTHING, undefined);
is(HTMLSourceElement.prototype.HAVE_METADATA, undefined);
is(HTMLSourceElement.prototype.HAVE_CURRENT_DATA, undefined);
is(HTMLSourceElement.prototype.HAVE_FUTURE_DATA, undefined);
is(HTMLSourceElement.prototype.HAVE_ENOUGH_DATA, undefined);
is(HTMLSourceElement.prototype.MEDIA_ERR_ABORTED, undefined);
is(HTMLSourceElement.prototype.MEDIA_ERR_NETWORK, undefined);
is(HTMLSourceElement.prototype.MEDIA_ERR_DECODE, undefined);
is(HTMLSourceElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined);
is(HTMLMediaError.prototype.NETWORK_EMPTY, undefined);
is(HTMLMediaError.prototype.NETWORK_IDLE, undefined);
is(HTMLMediaError.prototype.NETWORK_LOADING, undefined);
is(HTMLMediaError.prototype.NETWORK_LOADED, undefined);
is(HTMLMediaError.prototype.NETWORK_NO_SOURCE, undefined);
is(HTMLMediaError.prototype.HAVE_NOTHING, undefined);
is(HTMLMediaError.prototype.HAVE_METADATA, undefined);
is(HTMLMediaError.prototype.HAVE_CURRENT_DATA, undefined);
is(HTMLMediaError.prototype.HAVE_FUTURE_DATA, undefined);
is(HTMLMediaError.prototype.HAVE_ENOUGH_DATA, undefined);
is(HTMLMediaError.prototype.MEDIA_ERR_ABORTED, 1);
is(HTMLMediaError.prototype.MEDIA_ERR_NETWORK, 2);
is(HTMLMediaError.prototype.MEDIA_ERR_DECODE, 3);
is(HTMLMediaError.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, 4);
</script>
</pre>
</body>
</html>