Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / content / media / video / test / test_seek8.html
blob5655bb53b2a01ea34739622bc5d4e05a5d8a6e59
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>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 <video id='v'
11 src='seek.ogg'
12 onloadedmetadata='return startTest();'></video>
13 <pre id="test">
14 <script class="testbody" type="text/javascript">
15 // If a NaN is passed to currentTime, make sure this is caught
16 // otherwise an infinite loop in the Ogg backend occurs.
17 var v = document.getElementById('v');
18 var completed = false;
19 var thrown1 = false;
20 var thrown2 = false;
21 var thrown3 = false;
23 function startTest() {
24 if (completed)
25 return false;
27 try {
28 v.currentTime = NaN;
29 } catch(e) {
30 thrown1 = true;
33 try {
34 v.currentTime = -1;
35 } catch(e) {
36 thrown2 = true;
39 try {
40 v.currentTime = Math.random;
41 } catch(e) {
42 thrown3 = true;
45 completed = true;
46 ok(thrown1, "Setting currentTime to invalid value of NaN");
47 ok(thrown2, "Setting currentTime to invalid value of -1");
48 ok(thrown3, "Setting currentTime to invalid value of a function");
49 SimpleTest.finish();
50 return false;
53 SimpleTest.waitForExplicitFinish();
54 </script>
55 </pre>
56 </body>
57 </html>