Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_wav_seek8.html
blob16d7cc995d9ac044f623263e345b1de0bcc0bf90
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Wave Media test: seek test 8</title>
5 <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
6 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
8 </head>
9 <body>
10 <audio id='v'
11 onloadedmetadata='return startTest();'>
12 <source type='audio/x-wav' src='r11025_s16_c1.wav'>
13 </audio>
14 <pre id="test">
15 <script class="testbody" type="text/javascript">
16 // If a NaN is passed to currentTime, make sure this is caught
17 // otherwise an infinite loop in the Wave backend occurs.
18 var v = document.getElementById('v');
19 var completed = false;
20 var thrown1 = false;
21 var thrown2 = false;
22 var thrown3 = false;
24 function startTest() {
25 if (completed)
26 return false;
28 try {
29 v.currentTime = NaN;
30 } catch(e) {
31 thrown1 = true;
34 try {
35 v.currentTime = -1;
36 } catch(e) {
37 thrown2 = true;
40 try {
41 v.currentTime = Math.random;
42 } catch(e) {
43 thrown3 = true;
46 completed = true;
47 ok(thrown1, "Setting currentTime to invalid value of NaN");
48 ok(thrown2, "Setting currentTime to invalid value of -1");
49 ok(thrown3, "Setting currentTime to invalid value of a function");
50 SimpleTest.finish();
51 return false;
54 SimpleTest.waitForExplicitFinish();
55 </script>
56 </pre>
57 </body>
58 </html>