|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 "use strict"; |
|
5 |
|
6 const Profiler = Cc["@mozilla.org/tools/profiler;1"].getService(Ci.nsIProfiler); |
|
7 |
|
8 function check_actors(expect) { |
|
9 do_check_eq(expect, DebuggerServer.tabActorFactories.hasOwnProperty("registeredActor1")); |
|
10 do_check_eq(expect, DebuggerServer.tabActorFactories.hasOwnProperty("registeredActor2")); |
|
11 |
|
12 do_check_eq(expect, DebuggerServer.globalActorFactories.hasOwnProperty("registeredActor2")); |
|
13 do_check_eq(expect, DebuggerServer.globalActorFactories.hasOwnProperty("registeredActor1")); |
|
14 } |
|
15 |
|
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"); |
|
22 |
|
23 check_actors(true); |
|
24 |
|
25 check_except(() => { |
|
26 DebuggerServer.registerModule("xpcshell-test/registertestactors-01"); |
|
27 }); |
|
28 check_except(() => { |
|
29 DebuggerServer.registerModule("xpcshell-test/registertestactors-02"); |
|
30 }); |
|
31 |
|
32 DebuggerServer.unregisterModule("xpcshell-test/registertestactors-01"); |
|
33 DebuggerServer.unregisterModule("xpcshell-test/registertestactors-02"); |
|
34 check_actors(false); |
|
35 |
|
36 DebuggerServer.registerModule("xpcshell-test/registertestactors-01"); |
|
37 DebuggerServer.registerModule("xpcshell-test/registertestactors-02"); |
|
38 check_actors(true); |
|
39 |
|
40 DebuggerServer.destroy(); |
|
41 check_actors(false); |
|
42 } |
|
43 |