Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
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 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";
17 /* Test for Bug 865919:
18 * BMP with height of INT32_MIN should fail to decode.
19 */
21 SimpleTest.waitForExplicitFinish();
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);
29 var outstandingCallbacks = 2;
31 function CallbackAssert(assertVal, failText) {
32 ok(assertVal, failText);
34 outstandingCallbacks--;
35 ok(outstandingCallbacks >= 0, '`outstandingCallbacks` should be non-negative.');
36 if (outstandingCallbacks)
37 return;
39 // No outstanding callbacks remain, so we're done.
40 SimpleTest.finish();
41 }
43 </script>
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>
51 </body>
52 </html>