content/media/test/test_constants.html

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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.

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

mercurial