toolkit/devtools/server/tests/unit/test_register_actor.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 Profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler);
     8 function check_actors(expect) {
     9   do_check_eq(expect, DebuggerServer.tabActorFactories.hasOwnProperty("registeredActor1"));
    10   do_check_eq(expect, DebuggerServer.tabActorFactories.hasOwnProperty("registeredActor2"));
    12   do_check_eq(expect, DebuggerServer.globalActorFactories.hasOwnProperty("registeredActor2"));
    13   do_check_eq(expect, DebuggerServer.globalActorFactories.hasOwnProperty("registeredActor1"));
    14 }
    16 function run_test()
    17 {
    18   DebuggerServer.init(function () { return true; });
    19   // The xpcshell-test/ path maps to resource://test/
    20   DebuggerServer.registerModule("xpcshell-test/registertestactors-01");
    21   DebuggerServer.registerModule("xpcshell-test/registertestactors-02");
    23   check_actors(true);
    25   check_except(() => {
    26     DebuggerServer.registerModule("xpcshell-test/registertestactors-01");
    27   });
    28   check_except(() => {
    29     DebuggerServer.registerModule("xpcshell-test/registertestactors-02");
    30   });
    32   DebuggerServer.unregisterModule("xpcshell-test/registertestactors-01");
    33   DebuggerServer.unregisterModule("xpcshell-test/registertestactors-02");
    34   check_actors(false);
    36   DebuggerServer.registerModule("xpcshell-test/registertestactors-01");
    37   DebuggerServer.registerModule("xpcshell-test/registertestactors-02");
    38   check_actors(true);
    40   DebuggerServer.destroy();
    41   check_actors(false);
    42 }

mercurial