1 /* Any copyright is dedicated to the Public Domain.
2 https://creativecommons.org/publicdomain/zero/1.0/ */
6 QueryInterface = ChromeUtils.generateQI([
7 "nsIXPCTestInterfaceA",
11 interfaces = [Ci.nsIXPCTestInterfaceA, Ci.nsIClassInfo, Ci.nsISupports];
12 contractID = "@mozilla.org/test/class;1";
13 classDescription = "description";
14 classID = Components.ID("{4da556d4-00fa-451a-a280-d2aec7c5f265}");
17 name = "this is a test";
20 let instance = new TestClass();
21 Assert.ok(instance, "can create an instance");
22 Assert.ok(instance.QueryInterface(Ci.nsIClassInfo), "can QI to nsIClassInfo");
24 let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
25 registrar.registerFactory(
27 instance.classDescription,
31 return instance.QueryInterface(iid);
35 Assert.ok(true, "successfully registered the factory");
37 let otherInstance = Cc["@mozilla.org/test/class;1"].createInstance(
38 Ci.nsIXPCTestInterfaceA
40 Assert.ok(otherInstance, "can create an instance via xpcom");