Tue, 06 Jan 2015 21:39:09 +0100
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 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 */
6 // Disables security checking our updates which haven't been signed
7 Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
9 Components.utils.import("resource://testing-common/httpd.js");
10 var server;
12 // nsIAddonUpdateCheckListener implementation
13 var updateListener = {
14 _count: 0,
16 onUpdateAvailable: function onAddonUpdateEnded(aAddon, aInstall) {
17 do_check_eq(aInstall.version, 10);
18 },
20 onNoUpdateAvailable: function onNoUpdateAvailable(aAddon) {
21 do_throw("Expected an available update for " + aAddon.id);
22 },
24 onUpdateFinished: function onUpdateFinished() {
25 if (++this._count == 2)
26 server.stop(do_test_finished);
27 },
28 }
30 function run_test()
31 {
32 // Setup for test
33 do_test_pending();
34 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9");
35 startupManager();
37 installAllFiles([do_get_addon("test_bug394300_1"),
38 do_get_addon("test_bug394300_2")], function() {
40 restartManager();
42 AddonManager.getAddonsByIDs(["bug394300_1@tests.mozilla.org",
43 "bug394300_2@tests.mozilla.org"], function(updates) {
45 do_check_neq(updates[0], null);
46 do_check_neq(updates[1], null);
48 server = new HttpServer();
49 server.registerDirectory("/", do_get_file("data"));
50 server.start(4444);
52 updates[0].findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
53 updates[1].findUpdates(updateListener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
54 });
55 });
56 }