toolkit/components/crashes/tests/xpcshell/test_crash_service.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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 });

mercurial