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 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
8 Cu.import("resource://gre/modules/Services.jsm", this);
9 Cu.import("resource://testing-common/AppData.jsm", this);
10 let bsp = Cu.import("resource://gre/modules/CrashManager.jsm", this);
12 function run_test() {
13 run_next_test();
14 }
16 add_task(function* test_instantiation() {
17 Assert.ok(!bsp.gCrashManager, "CrashManager global instance not initially defined.");
19 do_get_profile();
20 yield makeFakeAppDir();
22 // Fake profile creation.
23 Cc["@mozilla.org/crashservice;1"]
24 .getService(Ci.nsIObserver)
25 .observe(null, "profile-after-change", null);
27 Assert.ok(bsp.gCrashManager, "Profile creation makes it available.");
28 Assert.ok(Services.crashmanager, "CrashManager available via Services.");
29 Assert.strictEqual(bsp.gCrashManager, Services.crashmanager,
30 "The objects are the same.");
31 });