Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 Components.utils.import("resource://gre/modules/Preferences.jsm");
7 Components.utils.import("resource://gre/modules/UpdateChannel.jsm");
9 const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
10 const TEST_CHANNEL = "TestChannel";
11 const PREF_PARTNER_A = "app.partner.test_partner_a";
12 const TEST_PARTNER_A = "TestPartnerA";
13 const PREF_PARTNER_B = "app.partner.test_partner_b";
14 const TEST_PARTNER_B = "TestPartnerB";
16 function test_get() {
17 let defaultPrefs = new Preferences({ defaultBranch: true });
18 let currentChannel = defaultPrefs.get(PREF_APP_UPDATE_CHANNEL);
20 do_check_eq(UpdateChannel.get(), currentChannel);
21 do_check_eq(UpdateChannel.get(false), currentChannel);
23 defaultPrefs.set(PREF_APP_UPDATE_CHANNEL, TEST_CHANNEL);
24 do_check_eq(UpdateChannel.get(), TEST_CHANNEL);
25 do_check_eq(UpdateChannel.get(false), TEST_CHANNEL);
27 defaultPrefs.set(PREF_PARTNER_A, TEST_PARTNER_A);
28 defaultPrefs.set(PREF_PARTNER_B, TEST_PARTNER_B);
29 do_check_eq(UpdateChannel.get(),
30 TEST_CHANNEL + "-cck-" + TEST_PARTNER_A + "-" + TEST_PARTNER_B);
31 do_check_eq(UpdateChannel.get(false), TEST_CHANNEL);
32 }
34 function run_test() {
35 test_get();
36 }