Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | Adapted from: |
michael@0 | 5 | http://simon.html5.org/test/html/dom/interfaces/htmlelement/htmlmediaelement/const-unsigned-short/001.htm |
michael@0 | 6 | --> |
michael@0 | 7 | <head> |
michael@0 | 8 | <title>Media test: constants</title> |
michael@0 | 9 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 10 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <video><source></video><audio><source></audio> |
michael@0 | 14 | <pre id="test"> |
michael@0 | 15 | <script class="testbody" type="text/javascript"> |
michael@0 | 16 | is(HTMLElement.NETWORK_EMPTY, undefined); |
michael@0 | 17 | is(HTMLElement.NETWORK_IDLE, undefined); |
michael@0 | 18 | is(HTMLElement.NETWORK_LOADING, undefined); |
michael@0 | 19 | is(HTMLElement.NETWORK_NO_SOURCE, undefined); |
michael@0 | 20 | is(HTMLElement.HAVE_NOTHING, undefined); |
michael@0 | 21 | is(HTMLElement.HAVE_METADATA, undefined); |
michael@0 | 22 | is(HTMLElement.HAVE_CURRENT_DATA, undefined); |
michael@0 | 23 | is(HTMLElement.HAVE_FUTURE_DATA, undefined); |
michael@0 | 24 | is(HTMLElement.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 25 | is(HTMLElement.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 26 | is(HTMLElement.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 27 | is(HTMLElement.MEDIA_ERR_DECODE, undefined); |
michael@0 | 28 | is(HTMLElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 29 | is(HTMLMediaElement.NETWORK_EMPTY, 0); |
michael@0 | 30 | is(HTMLMediaElement.NETWORK_IDLE, 1); |
michael@0 | 31 | is(HTMLMediaElement.NETWORK_LOADING, 2); |
michael@0 | 32 | is(HTMLMediaElement.NETWORK_NO_SOURCE, 3); |
michael@0 | 33 | is(HTMLMediaElement.HAVE_NOTHING, 0); |
michael@0 | 34 | is(HTMLMediaElement.HAVE_METADATA, 1); |
michael@0 | 35 | is(HTMLMediaElement.HAVE_CURRENT_DATA, 2); |
michael@0 | 36 | is(HTMLMediaElement.HAVE_FUTURE_DATA, 3); |
michael@0 | 37 | is(HTMLMediaElement.HAVE_ENOUGH_DATA, 4); |
michael@0 | 38 | is(HTMLMediaElement.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 39 | is(HTMLMediaElement.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 40 | is(HTMLMediaElement.MEDIA_ERR_DECODE, undefined); |
michael@0 | 41 | is(HTMLMediaElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 42 | is(HTMLVideoElement.NETWORK_EMPTY, 0); |
michael@0 | 43 | is(HTMLVideoElement.NETWORK_IDLE, 1); |
michael@0 | 44 | is(HTMLVideoElement.NETWORK_LOADING, 2); |
michael@0 | 45 | is(HTMLVideoElement.NETWORK_NO_SOURCE, 3); |
michael@0 | 46 | is(HTMLVideoElement.HAVE_NOTHING, 0); |
michael@0 | 47 | is(HTMLVideoElement.HAVE_METADATA, 1); |
michael@0 | 48 | is(HTMLVideoElement.HAVE_CURRENT_DATA, 2); |
michael@0 | 49 | is(HTMLVideoElement.HAVE_FUTURE_DATA, 3); |
michael@0 | 50 | is(HTMLVideoElement.HAVE_ENOUGH_DATA, 4); |
michael@0 | 51 | is(HTMLVideoElement.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 52 | is(HTMLVideoElement.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 53 | is(HTMLVideoElement.MEDIA_ERR_DECODE, undefined); |
michael@0 | 54 | is(HTMLVideoElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 55 | is(HTMLAudioElement.NETWORK_EMPTY, 0); |
michael@0 | 56 | is(HTMLAudioElement.NETWORK_IDLE, 1); |
michael@0 | 57 | is(HTMLAudioElement.NETWORK_LOADING, 2); |
michael@0 | 58 | is(HTMLAudioElement.NETWORK_NO_SOURCE, 3); |
michael@0 | 59 | is(HTMLAudioElement.HAVE_NOTHING, 0); |
michael@0 | 60 | is(HTMLAudioElement.HAVE_METADATA, 1); |
michael@0 | 61 | is(HTMLAudioElement.HAVE_CURRENT_DATA, 2); |
michael@0 | 62 | is(HTMLAudioElement.HAVE_FUTURE_DATA, 3); |
michael@0 | 63 | is(HTMLAudioElement.HAVE_ENOUGH_DATA, 4); |
michael@0 | 64 | is(HTMLAudioElement.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 65 | is(HTMLAudioElement.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 66 | is(HTMLAudioElement.MEDIA_ERR_DECODE, undefined); |
michael@0 | 67 | is(HTMLAudioElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 68 | is(HTMLSourceElement.NETWORK_EMPTY, undefined); |
michael@0 | 69 | is(HTMLSourceElement.NETWORK_IDLE, undefined); |
michael@0 | 70 | is(HTMLSourceElement.NETWORK_LOADING, undefined); |
michael@0 | 71 | is(HTMLSourceElement.NETWORK_NO_SOURCE, undefined); |
michael@0 | 72 | is(HTMLSourceElement.HAVE_NOTHING, undefined); |
michael@0 | 73 | is(HTMLSourceElement.HAVE_METADATA, undefined); |
michael@0 | 74 | is(HTMLSourceElement.HAVE_CURRENT_DATA, undefined); |
michael@0 | 75 | is(HTMLSourceElement.HAVE_FUTURE_DATA, undefined); |
michael@0 | 76 | is(HTMLSourceElement.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 77 | is(HTMLSourceElement.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 78 | is(HTMLSourceElement.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 79 | is(HTMLSourceElement.MEDIA_ERR_DECODE, undefined); |
michael@0 | 80 | is(HTMLSourceElement.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 81 | is(MediaError.NETWORK_EMPTY, undefined); |
michael@0 | 82 | is(MediaError.NETWORK_IDLE, undefined); |
michael@0 | 83 | is(MediaError.NETWORK_LOADING, undefined); |
michael@0 | 84 | is(MediaError.NETWORK_NO_SOURCE, undefined); |
michael@0 | 85 | is(MediaError.HAVE_NOTHING, undefined); |
michael@0 | 86 | is(MediaError.HAVE_METADATA, undefined); |
michael@0 | 87 | is(MediaError.HAVE_CURRENT_DATA, undefined); |
michael@0 | 88 | is(MediaError.HAVE_FUTURE_DATA, undefined); |
michael@0 | 89 | is(MediaError.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 90 | is(MediaError.MEDIA_ERR_ABORTED, 1); |
michael@0 | 91 | is(MediaError.MEDIA_ERR_NETWORK, 2); |
michael@0 | 92 | is(MediaError.MEDIA_ERR_DECODE, 3); |
michael@0 | 93 | is(MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED, 4); |
michael@0 | 94 | is(document.body.NETWORK_EMPTY, undefined); |
michael@0 | 95 | is(document.body.NETWORK_IDLE, undefined); |
michael@0 | 96 | is(document.body.NETWORK_LOADING, undefined); |
michael@0 | 97 | is(document.body.NETWORK_NO_SOURCE, undefined); |
michael@0 | 98 | is(document.body.HAVE_NOTHING, undefined); |
michael@0 | 99 | is(document.body.HAVE_METADATA, undefined); |
michael@0 | 100 | is(document.body.HAVE_CURRENT_DATA, undefined); |
michael@0 | 101 | is(document.body.HAVE_FUTURE_DATA, undefined); |
michael@0 | 102 | is(document.body.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 103 | is(document.body.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 104 | is(document.body.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 105 | is(document.body.MEDIA_ERR_DECODE, undefined); |
michael@0 | 106 | is(document.body.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 107 | is(document.getElementsByTagName("video")[0].NETWORK_EMPTY, 0); |
michael@0 | 108 | is(document.getElementsByTagName("video")[0].NETWORK_IDLE, 1); |
michael@0 | 109 | is(document.getElementsByTagName("video")[0].NETWORK_LOADING, 2); |
michael@0 | 110 | is(document.getElementsByTagName("video")[0].NETWORK_NO_SOURCE, 3); |
michael@0 | 111 | is(document.getElementsByTagName("video")[0].HAVE_NOTHING, 0); |
michael@0 | 112 | is(document.getElementsByTagName("video")[0].HAVE_METADATA, 1); |
michael@0 | 113 | is(document.getElementsByTagName("video")[0].HAVE_CURRENT_DATA, 2); |
michael@0 | 114 | is(document.getElementsByTagName("video")[0].HAVE_FUTURE_DATA, 3); |
michael@0 | 115 | is(document.getElementsByTagName("video")[0].HAVE_ENOUGH_DATA, 4); |
michael@0 | 116 | is(document.getElementsByTagName("video")[0].MEDIA_ERR_ABORTED, undefined); |
michael@0 | 117 | is(document.getElementsByTagName("video")[0].MEDIA_ERR_NETWORK, undefined); |
michael@0 | 118 | is(document.getElementsByTagName("video")[0].MEDIA_ERR_DECODE, undefined); |
michael@0 | 119 | is(document.getElementsByTagName("video")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 120 | is(document.getElementsByTagName("audio")[0].NETWORK_EMPTY, 0); |
michael@0 | 121 | is(document.getElementsByTagName("audio")[0].NETWORK_IDLE, 1); |
michael@0 | 122 | is(document.getElementsByTagName("audio")[0].NETWORK_LOADING, 2); |
michael@0 | 123 | is(document.getElementsByTagName("audio")[0].NETWORK_NO_SOURCE, 3); |
michael@0 | 124 | is(document.getElementsByTagName("audio")[0].HAVE_NOTHING, 0); |
michael@0 | 125 | is(document.getElementsByTagName("audio")[0].HAVE_METADATA, 1); |
michael@0 | 126 | is(document.getElementsByTagName("audio")[0].HAVE_CURRENT_DATA, 2); |
michael@0 | 127 | is(document.getElementsByTagName("audio")[0].HAVE_FUTURE_DATA, 3); |
michael@0 | 128 | is(document.getElementsByTagName("audio")[0].HAVE_ENOUGH_DATA, 4); |
michael@0 | 129 | is(document.getElementsByTagName("audio")[0].MEDIA_ERR_ABORTED, undefined); |
michael@0 | 130 | is(document.getElementsByTagName("audio")[0].MEDIA_ERR_NETWORK, undefined); |
michael@0 | 131 | is(document.getElementsByTagName("audio")[0].MEDIA_ERR_DECODE, undefined); |
michael@0 | 132 | is(document.getElementsByTagName("audio")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 133 | is(document.getElementsByTagName("source")[0].NETWORK_EMPTY, undefined); |
michael@0 | 134 | is(document.getElementsByTagName("source")[0].NETWORK_IDLE, undefined); |
michael@0 | 135 | is(document.getElementsByTagName("source")[0].NETWORK_LOADING, undefined); |
michael@0 | 136 | is(document.getElementsByTagName("source")[0].NETWORK_NO_SOURCE, undefined); |
michael@0 | 137 | is(document.getElementsByTagName("source")[0].HAVE_NOTHING, undefined); |
michael@0 | 138 | is(document.getElementsByTagName("source")[0].HAVE_METADATA, undefined); |
michael@0 | 139 | is(document.getElementsByTagName("source")[0].HAVE_CURRENT_DATA, undefined); |
michael@0 | 140 | is(document.getElementsByTagName("source")[0].HAVE_FUTURE_DATA, undefined); |
michael@0 | 141 | is(document.getElementsByTagName("source")[0].HAVE_ENOUGH_DATA, undefined); |
michael@0 | 142 | is(document.getElementsByTagName("source")[0].MEDIA_ERR_ABORTED, undefined); |
michael@0 | 143 | is(document.getElementsByTagName("source")[0].MEDIA_ERR_NETWORK, undefined); |
michael@0 | 144 | is(document.getElementsByTagName("source")[0].MEDIA_ERR_DECODE, undefined); |
michael@0 | 145 | is(document.getElementsByTagName("source")[0].MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 146 | is(HTMLElement.prototype.NETWORK_EMPTY, undefined); |
michael@0 | 147 | is(HTMLElement.prototype.NETWORK_IDLE, undefined); |
michael@0 | 148 | is(HTMLElement.prototype.NETWORK_LOADING, undefined); |
michael@0 | 149 | is(HTMLElement.prototype.NETWORK_NO_SOURCE, undefined); |
michael@0 | 150 | is(HTMLElement.prototype.HAVE_NOTHING, undefined); |
michael@0 | 151 | is(HTMLElement.prototype.HAVE_METADATA, undefined); |
michael@0 | 152 | is(HTMLElement.prototype.HAVE_CURRENT_DATA, undefined); |
michael@0 | 153 | is(HTMLElement.prototype.HAVE_FUTURE_DATA, undefined); |
michael@0 | 154 | is(HTMLElement.prototype.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 155 | is(HTMLElement.prototype.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 156 | is(HTMLElement.prototype.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 157 | is(HTMLElement.prototype.MEDIA_ERR_DECODE, undefined); |
michael@0 | 158 | is(HTMLElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 159 | is(HTMLMediaElement.prototype.NETWORK_EMPTY, 0, "HTMLMediaElement.prototype.NETWORK_EMPTY"); |
michael@0 | 160 | is(HTMLMediaElement.prototype.NETWORK_IDLE, 1, "HTMLMediaElement.prototype.NETWORK_IDLE"); |
michael@0 | 161 | is(HTMLMediaElement.prototype.NETWORK_LOADING, 2, "HTMLMediaElement.prototype.NETWORK_LOADING"); |
michael@0 | 162 | is(HTMLMediaElement.prototype.NETWORK_NO_SOURCE, 3, "HTMLMediaElement.prototype.NETWORK_NO_SOURCE"); |
michael@0 | 163 | is(HTMLMediaElement.prototype.HAVE_NOTHING, 0, "HTMLMediaElement.prototype.HAVE_NOTHING"); |
michael@0 | 164 | is(HTMLMediaElement.prototype.HAVE_METADATA, 1, "HTMLMediaElement.prototype.HAVE_METADATA"); |
michael@0 | 165 | is(HTMLMediaElement.prototype.HAVE_CURRENT_DATA, 2, "HTMLMediaElement.prototype.HAVE_CURRENT_DATA"); |
michael@0 | 166 | is(HTMLMediaElement.prototype.HAVE_FUTURE_DATA, 3, "HTMLMediaElement.prototype.HAVE_FUTURE_DATA"); |
michael@0 | 167 | is(HTMLMediaElement.prototype.HAVE_ENOUGH_DATA, 4, "HTMLMediaElement.prototype.HAVE_ENOUGH_DATA"); |
michael@0 | 168 | is(HTMLMediaElement.prototype.MEDIA_ERR_ABORTED, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_ABORTED"); |
michael@0 | 169 | is(HTMLMediaElement.prototype.MEDIA_ERR_NETWORK, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_NETWORK"); |
michael@0 | 170 | is(HTMLMediaElement.prototype.MEDIA_ERR_DECODE, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_DECODE"); |
michael@0 | 171 | is(HTMLMediaElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined, "HTMLMediaElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED"); |
michael@0 | 172 | is(HTMLVideoElement.prototype.NETWORK_EMPTY, 0); |
michael@0 | 173 | is(HTMLVideoElement.prototype.NETWORK_IDLE, 1); |
michael@0 | 174 | is(HTMLVideoElement.prototype.NETWORK_LOADING, 2); |
michael@0 | 175 | is(HTMLVideoElement.prototype.NETWORK_NO_SOURCE, 3); |
michael@0 | 176 | is(HTMLVideoElement.prototype.HAVE_NOTHING, 0); |
michael@0 | 177 | is(HTMLVideoElement.prototype.HAVE_METADATA, 1); |
michael@0 | 178 | is(HTMLVideoElement.prototype.HAVE_CURRENT_DATA, 2); |
michael@0 | 179 | is(HTMLVideoElement.prototype.HAVE_FUTURE_DATA, 3); |
michael@0 | 180 | is(HTMLVideoElement.prototype.HAVE_ENOUGH_DATA, 4); |
michael@0 | 181 | is(HTMLVideoElement.prototype.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 182 | is(HTMLVideoElement.prototype.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 183 | is(HTMLVideoElement.prototype.MEDIA_ERR_DECODE, undefined); |
michael@0 | 184 | is(HTMLVideoElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 185 | is(HTMLAudioElement.prototype.NETWORK_EMPTY, 0); |
michael@0 | 186 | is(HTMLAudioElement.prototype.NETWORK_IDLE, 1); |
michael@0 | 187 | is(HTMLAudioElement.prototype.NETWORK_LOADING, 2); |
michael@0 | 188 | is(HTMLAudioElement.prototype.NETWORK_NO_SOURCE, 3); |
michael@0 | 189 | is(HTMLAudioElement.prototype.HAVE_NOTHING, 0); |
michael@0 | 190 | is(HTMLAudioElement.prototype.HAVE_METADATA, 1); |
michael@0 | 191 | is(HTMLAudioElement.prototype.HAVE_CURRENT_DATA, 2); |
michael@0 | 192 | is(HTMLAudioElement.prototype.HAVE_FUTURE_DATA, 3); |
michael@0 | 193 | is(HTMLAudioElement.prototype.HAVE_ENOUGH_DATA, 4); |
michael@0 | 194 | is(HTMLAudioElement.prototype.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 195 | is(HTMLAudioElement.prototype.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 196 | is(HTMLAudioElement.prototype.MEDIA_ERR_DECODE, undefined); |
michael@0 | 197 | is(HTMLAudioElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 198 | is(HTMLSourceElement.prototype.NETWORK_EMPTY, undefined); |
michael@0 | 199 | is(HTMLSourceElement.prototype.NETWORK_IDLE, undefined); |
michael@0 | 200 | is(HTMLSourceElement.prototype.NETWORK_LOADING, undefined); |
michael@0 | 201 | is(HTMLSourceElement.prototype.NETWORK_NO_SOURCE, undefined); |
michael@0 | 202 | is(HTMLSourceElement.prototype.HAVE_NOTHING, undefined); |
michael@0 | 203 | is(HTMLSourceElement.prototype.HAVE_METADATA, undefined); |
michael@0 | 204 | is(HTMLSourceElement.prototype.HAVE_CURRENT_DATA, undefined); |
michael@0 | 205 | is(HTMLSourceElement.prototype.HAVE_FUTURE_DATA, undefined); |
michael@0 | 206 | is(HTMLSourceElement.prototype.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 207 | is(HTMLSourceElement.prototype.MEDIA_ERR_ABORTED, undefined); |
michael@0 | 208 | is(HTMLSourceElement.prototype.MEDIA_ERR_NETWORK, undefined); |
michael@0 | 209 | is(HTMLSourceElement.prototype.MEDIA_ERR_DECODE, undefined); |
michael@0 | 210 | is(HTMLSourceElement.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, undefined); |
michael@0 | 211 | is(MediaError.prototype.NETWORK_EMPTY, undefined); |
michael@0 | 212 | is(MediaError.prototype.NETWORK_IDLE, undefined); |
michael@0 | 213 | is(MediaError.prototype.NETWORK_LOADING, undefined); |
michael@0 | 214 | is(MediaError.prototype.NETWORK_NO_SOURCE, undefined); |
michael@0 | 215 | is(MediaError.prototype.HAVE_NOTHING, undefined); |
michael@0 | 216 | is(MediaError.prototype.HAVE_METADATA, undefined); |
michael@0 | 217 | is(MediaError.prototype.HAVE_CURRENT_DATA, undefined); |
michael@0 | 218 | is(MediaError.prototype.HAVE_FUTURE_DATA, undefined); |
michael@0 | 219 | is(MediaError.prototype.HAVE_ENOUGH_DATA, undefined); |
michael@0 | 220 | is(MediaError.prototype.MEDIA_ERR_ABORTED, 1); |
michael@0 | 221 | is(MediaError.prototype.MEDIA_ERR_NETWORK, 2); |
michael@0 | 222 | is(MediaError.prototype.MEDIA_ERR_DECODE, 3); |
michael@0 | 223 | is(MediaError.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED, 4); |
michael@0 | 224 | ok(document.getElementsByTagName("video")[0].buffered instanceof TimeRanges, "video.buffered must be TimeRanges object"); |
michael@0 | 225 | </script> |
michael@0 | 226 | </pre> |
michael@0 | 227 | </body> |
michael@0 | 228 | </html> |