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 /* 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 var cps = new ContentPrefInstance(null);
5 var uri = ContentPrefTest.getURI("http://www.example.com/");
7 function run_test() {
8 do_test_pending();
10 cps.setPref(uri, "asynctest", "pie");
11 do_check_eq(cps.getPref(uri, "asynctest"), "pie");
13 cps.getPref(uri, "asynctest", function(aValue) {
14 do_check_eq(aValue, "pie");
15 testCallbackObj();
16 });
17 }
19 function testCallbackObj() {
20 cps.getPref(uri, "asynctest", {
21 onResult: function(aValue) {
22 do_check_eq(aValue, "pie");
23 cps.removePref(uri, "asynctest");
24 testNoResult();
25 }
26 });
27 }
29 function testNoResult() {
30 cps.getPref(uri, "asynctest", function(aValue) {
31 do_check_eq(aValue, undefined);
32 do_test_finished();
33 });
34 }