|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=865919 |
|
5 --> |
|
6 <head> |
|
7 <meta charset="UTF-8"> |
|
8 <title>Test for Bug 865919</title> |
|
9 <script type="application/javascript" src="/MochiKit/MochiKit.js"></script> |
|
10 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
12 </head> |
|
13 <body> |
|
14 <script type="text/javascript"> |
|
15 "use strict"; |
|
16 |
|
17 /* Test for Bug 865919: |
|
18 * BMP with height of INT32_MIN should fail to decode. |
|
19 */ |
|
20 |
|
21 SimpleTest.waitForExplicitFinish(); |
|
22 |
|
23 var req = new XMLHttpRequest(); |
|
24 req.onload = function() { CallbackAssert(true, 'Request for file succeeded.'); }; |
|
25 req.onerror = function() { CallbackAssert(false, 'Request for file failed! Failed to test non-existent file.'); }; |
|
26 req.open('GET', 'INT32_MIN.bmp'); |
|
27 req.send(null); |
|
28 |
|
29 var outstandingCallbacks = 2; |
|
30 |
|
31 function CallbackAssert(assertVal, failText) { |
|
32 ok(assertVal, failText); |
|
33 |
|
34 outstandingCallbacks--; |
|
35 ok(outstandingCallbacks >= 0, '`outstandingCallbacks` should be non-negative.'); |
|
36 if (outstandingCallbacks) |
|
37 return; |
|
38 |
|
39 // No outstanding callbacks remain, so we're done. |
|
40 SimpleTest.finish(); |
|
41 } |
|
42 |
|
43 </script> |
|
44 |
|
45 <div id='content'> |
|
46 <img src='INT32_MIN.bmp' |
|
47 onerror='CallbackAssert(true, "Got expected onerror for INT32_MIN.bmp")' |
|
48 onload='CallbackAssert(false, "Got unexpected onload for INT32_MIN.bmp")'> |
|
49 </div> |
|
50 |
|
51 </body> |
|
52 </html> |
|
53 |