1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/test/test_constants.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,228 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 + Adapted from: 1.8 + http://simon.html5.org/test/html/dom/interfaces/htmlelement/htmlmediaelement/const-unsigned-short/001.htm 1.9 +--> 1.10 +<head> 1.11 + <title>Media test: constants</title> 1.12 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.14 +</head> 1.15 +<body> 1.16 +<video><source></video><audio><source></audio> 1.17 +<pre id="test"> 1.18 +<script class="testbody" type="text/javascript"> 1.19 +is(HTMLElement.NETWORK_EMPTY, undefined); 1.20 +is(HTMLElement.NETWORK_IDLE, undefined); 1.21 +is(HTMLElement.NETWORK_LOADING, undefined); 1.22 +is(HTMLElement.NETWORK_NO_SOURCE, undefined); 1.23 +is(HTMLElement.HAVE_NOTHING, undefined); 1.24 +is(HTMLElement.HAVE_METADATA, undefined); 1.25 +is(HTMLElement.HAVE_CURRENT_DATA, undefined); 1.26 +is(HTMLElement.HAVE_FUTURE_DATA, undefined); 1.27 +is(HTMLElement.HAVE_ENOUGH_DATA, undefined); 1.28 +is(HTMLElement.MEDIA_ERR_ABORTED, undefined); 1.29 +is(HTMLElement.MEDIA_ERR_NETWORK, undefined); 1.30 +is(HTMLElement.MEDIA_ERR_DECODE, undefined); 1.31 +is(HTMLElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.32 +is(HTMLMediaElement.NETWORK_EMPTY, 0); 1.33 +is(HTMLMediaElement.NETWORK_IDLE, 1); 1.34 +is(HTMLMediaElement.NETWORK_LOADING, 2); 1.35 +is(HTMLMediaElement.NETWORK_NO_SOURCE, 3); 1.36 +is(HTMLMediaElement.HAVE_NOTHING, 0); 1.37 +is(HTMLMediaElement.HAVE_METADATA, 1); 1.38 +is(HTMLMediaElement.HAVE_CURRENT_DATA, 2); 1.39 +is(HTMLMediaElement.HAVE_FUTURE_DATA, 3); 1.40 +is(HTMLMediaElement.HAVE_ENOUGH_DATA, 4); 1.41 +is(HTMLMediaElement.MEDIA_ERR_ABORTED, undefined); 1.42 +is(HTMLMediaElement.MEDIA_ERR_NETWORK, undefined); 1.43 +is(HTMLMediaElement.MEDIA_ERR_DECODE, undefined); 1.44 +is(HTMLMediaElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.45 +is(HTMLVideoElement.NETWORK_EMPTY, 0); 1.46 +is(HTMLVideoElement.NETWORK_IDLE, 1); 1.47 +is(HTMLVideoElement.NETWORK_LOADING, 2); 1.48 +is(HTMLVideoElement.NETWORK_NO_SOURCE, 3); 1.49 +is(HTMLVideoElement.HAVE_NOTHING, 0); 1.50 +is(HTMLVideoElement.HAVE_METADATA, 1); 1.51 +is(HTMLVideoElement.HAVE_CURRENT_DATA, 2); 1.52 +is(HTMLVideoElement.HAVE_FUTURE_DATA, 3); 1.53 +is(HTMLVideoElement.HAVE_ENOUGH_DATA, 4); 1.54 +is(HTMLVideoElement.MEDIA_ERR_ABORTED, undefined); 1.55 +is(HTMLVideoElement.MEDIA_ERR_NETWORK, undefined); 1.56 +is(HTMLVideoElement.MEDIA_ERR_DECODE, undefined); 1.57 +is(HTMLVideoElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.58 +is(HTMLAudioElement.NETWORK_EMPTY, 0); 1.59 +is(HTMLAudioElement.NETWORK_IDLE, 1); 1.60 +is(HTMLAudioElement.NETWORK_LOADING, 2); 1.61 +is(HTMLAudioElement.NETWORK_NO_SOURCE, 3); 1.62 +is(HTMLAudioElement.HAVE_NOTHING, 0); 1.63 +is(HTMLAudioElement.HAVE_METADATA, 1); 1.64 +is(HTMLAudioElement.HAVE_CURRENT_DATA, 2); 1.65 +is(HTMLAudioElement.HAVE_FUTURE_DATA, 3); 1.66 +is(HTMLAudioElement.HAVE_ENOUGH_DATA, 4); 1.67 +is(HTMLAudioElement.MEDIA_ERR_ABORTED, undefined); 1.68 +is(HTMLAudioElement.MEDIA_ERR_NETWORK, undefined); 1.69 +is(HTMLAudioElement.MEDIA_ERR_DECODE, undefined); 1.70 +is(HTMLAudioElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.71 +is(HTMLSourceElement.NETWORK_EMPTY, undefined); 1.72 +is(HTMLSourceElement.NETWORK_IDLE, undefined); 1.73 +is(HTMLSourceElement.NETWORK_LOADING, undefined); 1.74 +is(HTMLSourceElement.NETWORK_NO_SOURCE, undefined); 1.75 +is(HTMLSourceElement.HAVE_NOTHING, undefined); 1.76 +is(HTMLSourceElement.HAVE_METADATA, undefined); 1.77 +is(HTMLSourceElement.HAVE_CURRENT_DATA, undefined); 1.78 +is(HTMLSourceElement.HAVE_FUTURE_DATA, undefined); 1.79 +is(HTMLSourceElement.HAVE_ENOUGH_DATA, undefined); 1.80 +is(HTMLSourceElement.MEDIA_ERR_ABORTED, undefined); 1.81 +is(HTMLSourceElement.MEDIA_ERR_NETWORK, undefined); 1.82 +is(HTMLSourceElement.MEDIA_ERR_DECODE, undefined); 1.83 +is(HTMLSourceElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.84 +is(MediaError.NETWORK_EMPTY, undefined); 1.85 +is(MediaError.NETWORK_IDLE, undefined); 1.86 +is(MediaError.NETWORK_LOADING, undefined); 1.87 +is(MediaError.NETWORK_NO_SOURCE, undefined); 1.88 +is(MediaError.HAVE_NOTHING, undefined); 1.89 +is(MediaError.HAVE_METADATA, undefined); 1.90 +is(MediaError.HAVE_CURRENT_DATA, undefined); 1.91 +is(MediaError.HAVE_FUTURE_DATA, undefined); 1.92 +is(MediaError.HAVE_ENOUGH_DATA, undefined); 1.93 +is(MediaError.MEDIA_ERR_ABORTED, 1); 1.94 +is(MediaError.MEDIA_ERR_NETWORK, 2); 1.95 +is(MediaError.MEDIA_ERR_DECODE, 3); 1.96 +is(MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED, 4); 1.97 +is(document.body.NETWORK_EMPTY, undefined); 1.98 +is(document.body.NETWORK_IDLE, undefined); 1.99 +is(document.body.NETWORK_LOADING, undefined); 1.100 +is(document.body.NETWORK_NO_SOURCE, undefined); 1.101 +is(document.body.HAVE_NOTHING, undefined); 1.102 +is(document.body.HAVE_METADATA, undefined); 1.103 +is(document.body.HAVE_CURRENT_DATA, undefined); 1.104 +is(document.body.HAVE_FUTURE_DATA, undefined); 1.105 +is(document.body.HAVE_ENOUGH_DATA, undefined); 1.106 +is(document.body.MEDIA_ERR_ABORTED, undefined); 1.107 +is(document.body.MEDIA_ERR_NETWORK, undefined); 1.108 +is(document.body.MEDIA_ERR_DECODE, undefined); 1.109 +is(document.body.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.110 +is(document.getElementsByTagName("video")[0].NETWORK_EMPTY, 0); 1.111 +is(document.getElementsByTagName("video")[0].NETWORK_IDLE, 1); 1.112 +is(document.getElementsByTagName("video")[0].NETWORK_LOADING, 2); 1.113 +is(document.getElementsByTagName("video")[0].NETWORK_NO_SOURCE, 3); 1.114 +is(document.getElementsByTagName("video")[0].HAVE_NOTHING, 0); 1.115 +is(document.getElementsByTagName("video")[0].HAVE_METADATA, 1); 1.116 +is(document.getElementsByTagName("video")[0].HAVE_CURRENT_DATA, 2); 1.117 +is(document.getElementsByTagName("video")[0].HAVE_FUTURE_DATA, 3); 1.118 +is(document.getElementsByTagName("video")[0].HAVE_ENOUGH_DATA, 4); 1.119 +is(document.getElementsByTagName("video")[0].MEDIA_ERR_ABORTED, undefined); 1.120 +is(document.getElementsByTagName("video")[0].MEDIA_ERR_NETWORK, undefined); 1.121 +is(document.getElementsByTagName("video")[0].MEDIA_ERR_DECODE, undefined); 1.122 +is(document.getElementsByTagName("video")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.123 +is(document.getElementsByTagName("audio")[0].NETWORK_EMPTY, 0); 1.124 +is(document.getElementsByTagName("audio")[0].NETWORK_IDLE, 1); 1.125 +is(document.getElementsByTagName("audio")[0].NETWORK_LOADING, 2); 1.126 +is(document.getElementsByTagName("audio")[0].NETWORK_NO_SOURCE, 3); 1.127 +is(document.getElementsByTagName("audio")[0].HAVE_NOTHING, 0); 1.128 +is(document.getElementsByTagName("audio")[0].HAVE_METADATA, 1); 1.129 +is(document.getElementsByTagName("audio")[0].HAVE_CURRENT_DATA, 2); 1.130 +is(document.getElementsByTagName("audio")[0].HAVE_FUTURE_DATA, 3); 1.131 +is(document.getElementsByTagName("audio")[0].HAVE_ENOUGH_DATA, 4); 1.132 +is(document.getElementsByTagName("audio")[0].MEDIA_ERR_ABORTED, undefined); 1.133 +is(document.getElementsByTagName("audio")[0].MEDIA_ERR_NETWORK, undefined); 1.134 +is(document.getElementsByTagName("audio")[0].MEDIA_ERR_DECODE, undefined); 1.135 +is(document.getElementsByTagName("audio")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.136 +is(document.getElementsByTagName("source")[0].NETWORK_EMPTY, undefined); 1.137 +is(document.getElementsByTagName("source")[0].NETWORK_IDLE, undefined); 1.138 +is(document.getElementsByTagName("source")[0].NETWORK_LOADING, undefined); 1.139 +is(document.getElementsByTagName("source")[0].NETWORK_NO_SOURCE, undefined); 1.140 +is(document.getElementsByTagName("source")[0].HAVE_NOTHING, undefined); 1.141 +is(document.getElementsByTagName("source")[0].HAVE_METADATA, undefined); 1.142 +is(document.getElementsByTagName("source")[0].HAVE_CURRENT_DATA, undefined); 1.143 +is(document.getElementsByTagName("source")[0].HAVE_FUTURE_DATA, undefined); 1.144 +is(document.getElementsByTagName("source")[0].HAVE_ENOUGH_DATA, undefined); 1.145 +is(document.getElementsByTagName("source")[0].MEDIA_ERR_ABORTED, undefined); 1.146 +is(document.getElementsByTagName("source")[0].MEDIA_ERR_NETWORK, undefined); 1.147 +is(document.getElementsByTagName("source")[0].MEDIA_ERR_DECODE, undefined); 1.148 +is(document.getElementsByTagName("source")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.149 +is(HTMLElement.prototype.NETWORK_EMPTY, undefined); 1.150 +is(HTMLElement.prototype.NETWORK_IDLE, undefined); 1.151 +is(HTMLElement.prototype.NETWORK_LOADING, undefined); 1.152 +is(HTMLElement.prototype.NETWORK_NO_SOURCE, undefined); 1.153 +is(HTMLElement.prototype.HAVE_NOTHING, undefined); 1.154 +is(HTMLElement.prototype.HAVE_METADATA, undefined); 1.155 +is(HTMLElement.prototype.HAVE_CURRENT_DATA, undefined); 1.156 +is(HTMLElement.prototype.HAVE_FUTURE_DATA, undefined); 1.157 +is(HTMLElement.prototype.HAVE_ENOUGH_DATA, undefined); 1.158 +is(HTMLElement.prototype.MEDIA_ERR_ABORTED, undefined); 1.159 +is(HTMLElement.prototype.MEDIA_ERR_NETWORK, undefined); 1.160 +is(HTMLElement.prototype.MEDIA_ERR_DECODE, undefined); 1.161 +is(HTMLElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.162 +is(HTMLMediaElement.prototype.NETWORK_EMPTY, 0, "HTMLMediaElement.prototype.NETWORK_EMPTY"); 1.163 +is(HTMLMediaElement.prototype.NETWORK_IDLE, 1, "HTMLMediaElement.prototype.NETWORK_IDLE"); 1.164 +is(HTMLMediaElement.prototype.NETWORK_LOADING, 2, "HTMLMediaElement.prototype.NETWORK_LOADING"); 1.165 +is(HTMLMediaElement.prototype.NETWORK_NO_SOURCE, 3, "HTMLMediaElement.prototype.NETWORK_NO_SOURCE"); 1.166 +is(HTMLMediaElement.prototype.HAVE_NOTHING, 0, "HTMLMediaElement.prototype.HAVE_NOTHING"); 1.167 +is(HTMLMediaElement.prototype.HAVE_METADATA, 1, "HTMLMediaElement.prototype.HAVE_METADATA"); 1.168 +is(HTMLMediaElement.prototype.HAVE_CURRENT_DATA, 2, "HTMLMediaElement.prototype.HAVE_CURRENT_DATA"); 1.169 +is(HTMLMediaElement.prototype.HAVE_FUTURE_DATA, 3, "HTMLMediaElement.prototype.HAVE_FUTURE_DATA"); 1.170 +is(HTMLMediaElement.prototype.HAVE_ENOUGH_DATA, 4, "HTMLMediaElement.prototype.HAVE_ENOUGH_DATA"); 1.171 +is(HTMLMediaElement.prototype.MEDIA_ERR_ABORTED, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_ABORTED"); 1.172 +is(HTMLMediaElement.prototype.MEDIA_ERR_NETWORK, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_NETWORK"); 1.173 +is(HTMLMediaElement.prototype.MEDIA_ERR_DECODE, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_DECODE"); 1.174 +is(HTMLMediaElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED"); 1.175 +is(HTMLVideoElement.prototype.NETWORK_EMPTY, 0); 1.176 +is(HTMLVideoElement.prototype.NETWORK_IDLE, 1); 1.177 +is(HTMLVideoElement.prototype.NETWORK_LOADING, 2); 1.178 +is(HTMLVideoElement.prototype.NETWORK_NO_SOURCE, 3); 1.179 +is(HTMLVideoElement.prototype.HAVE_NOTHING, 0); 1.180 +is(HTMLVideoElement.prototype.HAVE_METADATA, 1); 1.181 +is(HTMLVideoElement.prototype.HAVE_CURRENT_DATA, 2); 1.182 +is(HTMLVideoElement.prototype.HAVE_FUTURE_DATA, 3); 1.183 +is(HTMLVideoElement.prototype.HAVE_ENOUGH_DATA, 4); 1.184 +is(HTMLVideoElement.prototype.MEDIA_ERR_ABORTED, undefined); 1.185 +is(HTMLVideoElement.prototype.MEDIA_ERR_NETWORK, undefined); 1.186 +is(HTMLVideoElement.prototype.MEDIA_ERR_DECODE, undefined); 1.187 +is(HTMLVideoElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.188 +is(HTMLAudioElement.prototype.NETWORK_EMPTY, 0); 1.189 +is(HTMLAudioElement.prototype.NETWORK_IDLE, 1); 1.190 +is(HTMLAudioElement.prototype.NETWORK_LOADING, 2); 1.191 +is(HTMLAudioElement.prototype.NETWORK_NO_SOURCE, 3); 1.192 +is(HTMLAudioElement.prototype.HAVE_NOTHING, 0); 1.193 +is(HTMLAudioElement.prototype.HAVE_METADATA, 1); 1.194 +is(HTMLAudioElement.prototype.HAVE_CURRENT_DATA, 2); 1.195 +is(HTMLAudioElement.prototype.HAVE_FUTURE_DATA, 3); 1.196 +is(HTMLAudioElement.prototype.HAVE_ENOUGH_DATA, 4); 1.197 +is(HTMLAudioElement.prototype.MEDIA_ERR_ABORTED, undefined); 1.198 +is(HTMLAudioElement.prototype.MEDIA_ERR_NETWORK, undefined); 1.199 +is(HTMLAudioElement.prototype.MEDIA_ERR_DECODE, undefined); 1.200 +is(HTMLAudioElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.201 +is(HTMLSourceElement.prototype.NETWORK_EMPTY, undefined); 1.202 +is(HTMLSourceElement.prototype.NETWORK_IDLE, undefined); 1.203 +is(HTMLSourceElement.prototype.NETWORK_LOADING, undefined); 1.204 +is(HTMLSourceElement.prototype.NETWORK_NO_SOURCE, undefined); 1.205 +is(HTMLSourceElement.prototype.HAVE_NOTHING, undefined); 1.206 +is(HTMLSourceElement.prototype.HAVE_METADATA, undefined); 1.207 +is(HTMLSourceElement.prototype.HAVE_CURRENT_DATA, undefined); 1.208 +is(HTMLSourceElement.prototype.HAVE_FUTURE_DATA, undefined); 1.209 +is(HTMLSourceElement.prototype.HAVE_ENOUGH_DATA, undefined); 1.210 +is(HTMLSourceElement.prototype.MEDIA_ERR_ABORTED, undefined); 1.211 +is(HTMLSourceElement.prototype.MEDIA_ERR_NETWORK, undefined); 1.212 +is(HTMLSourceElement.prototype.MEDIA_ERR_DECODE, undefined); 1.213 +is(HTMLSourceElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); 1.214 +is(MediaError.prototype.NETWORK_EMPTY, undefined); 1.215 +is(MediaError.prototype.NETWORK_IDLE, undefined); 1.216 +is(MediaError.prototype.NETWORK_LOADING, undefined); 1.217 +is(MediaError.prototype.NETWORK_NO_SOURCE, undefined); 1.218 +is(MediaError.prototype.HAVE_NOTHING, undefined); 1.219 +is(MediaError.prototype.HAVE_METADATA, undefined); 1.220 +is(MediaError.prototype.HAVE_CURRENT_DATA, undefined); 1.221 +is(MediaError.prototype.HAVE_FUTURE_DATA, undefined); 1.222 +is(MediaError.prototype.HAVE_ENOUGH_DATA, undefined); 1.223 +is(MediaError.prototype.MEDIA_ERR_ABORTED, 1); 1.224 +is(MediaError.prototype.MEDIA_ERR_NETWORK, 2); 1.225 +is(MediaError.prototype.MEDIA_ERR_DECODE, 3); 1.226 +is(MediaError.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, 4); 1.227 +ok(document.getElementsByTagName("video")[0].buffered instanceof TimeRanges, "video.buffered must be TimeRanges object"); 1.228 +</script> 1.229 +</pre> 1.230 +</body> 1.231 +</html>